151. |
What will be the output of the following Python code?
d = {0, 1, 2}
for x in d:
print(x)
|
||||||||
Answer:
Option (a) |
152. |
What will be the output of the following Python code?
d = {0, 1, 2}
for x in d:
print(d.add(x))
|
||||||||
Answer:
Option (c) |
153. |
What will be the output of the following Python code?
for i in range(0):
print(i)
|
||||||||
Answer:
Option (b) |
154. |
What will be the output of the following Python code?
for i in range(2.0):
print(i)
|
||||||||
Answer:
Option (c) |
155. |
What will be the output of the following Python code?
for i in range(int(2.0)):
print(i)
|
||||||||
Answer:
Option (b) |
156. |
What will be the output of the following Python code?
for i in range(float('inf')):
print (i)
|
||||||||
Answer:
Option (d) |
157. |
What will be the output of the following Python code snippet?
for i in [1, 2, 3, 4][::-1]:
print (i)
|
||||||||
Answer:
Option (b) |
158. |
What will be the output of the following Python code snippet?
for i in ''.join(reversed(list('abcd'))):
print (i)
|
||||||||
Answer:
Option (b) |
159. |
What will be the output of the following Python code snippet?
for i in 'abcd'[::-1]:
print (i)
|
||||||||
Answer:
Option (b) |
160. |
What will be the output of the following Python code snippet?
for i in '':
print (i)
|
||||||||
Answer:
Option (b) |