D522 PA MULTIPLE CHOICE
QUESTIONS WITH ALL PASSED
ANSWERS!!
1 of 39
Term
Which Python method is used to add an item to the end of a list?
Give this one a try later!
append() add()
insert() extend()
, Don't know?
2 of 39
Term
What is the output of the following Python code?
x=5
y = 10
print(x == y)
Give this one a try later!
5 False
True 10
Don't know?
3 of 39
Term
What is the output of the following code?
print(“Hello” + “World”)
Give this one a try later!
, HelloWorld Hello World
Don't know?
4 of 39
Term
What will be the result of this Python
code? fruits = [‘apple’, ‘banana’,
‘cherry’] print(fruits[-1])
Give this one a try later!
cherry IndexError
banana apple
Don't know?
5 of 39
Term
What is the default value of the step parameter in
Python’s string slicing?
Give this one a try later!