51
What will be the output of the following Python code?
a = ('check',)
n = 2
for i in range(int(n)):
a = (a,)
print(a)
Answer & Solution
Answer: Option
B
52
What will be the output of the following Python code?
>>>my_tuple = (1, 2, 3, 4)
>>>my_tuple.append( (5, 6, 7) )
>>>print len(my_tuple)
Answer & Solution
Answer: Option
D
53
What will be the output of the following Python code?
>>> a=(1,2,3,4)
>>> del(a[2])
Answer & Solution
Answer: Option
D
54
What will be the output of the following Python code?
>>>t = (1, 2, 4, 3, 8, 9)
>>>[t[i] for i in range(0, len(t), 2)]
Answer & Solution
Answer: Option
C
55
Is the following Python code valid?
>>> a,b=1,2,3
Answer & Solution
Answer: Option
C
56
Is the following Python code valid?
>>> a=2,3,4,5
>>> a
Answer & Solution
Answer: Option
D
57
What will be the output of the following Python code?
>>> a=(1,2,(4,5))
>>> b=(1,2,(3,4))
>>> a<b
Answer & Solution
Answer: Option
A
58
Is the following Python code valid?
>>> a=(1,2,3)
>>> b=a.update(4,)
Answer & Solution
Answer: Option
C
59
What will be the output of the following Python code?
>>>t=(1,2,4,3)
>>>t[1:3]
Answer & Solution
Answer: Option
C
60
What will be the output of the following Python code?
>>> a=(1,2)
>>> b=(3,4)
>>> c=a+b
>>> c
Answer & Solution
Answer: Option
B