Python List & Tuple MCQs

Question 11: What will be the output of the following code?

x = [x for x in range(10) if x <5] print(x)

Question 12: What will be the output of the following code?

lst = [1, 2, 3, 4, 5]
del lst[:]
print(lst)

Question 13: What will be the output of the following code?

lst = [1, 2, 3, 4, 5]
print(lst[0:1]

Question 14: What will be the output of the following code?

lst = [1, 2, 3, 4, 5]
print(lst[-5:-3])

Question 15: What will be the output of the following code?

lst = [1, 2, 3]
lst[:]=[4,5,6]
print(lst)

Question 16: What will be output of the following expression:

n= max('ten', 10, 10.00)
Print(n)

Question 17: Which of following will result in error?

Question 18: What will be the output of the following code?

names = ('Jeff', 'Bill', 'Steve', 'Yash') 
a, b, c, d = names 
print("Hello", a)

Question 19: Which of the following methods cannot be used with tuple?