| 141. |
What will be the output of the following Python code snippet?
x = 'abcd'
for i in range(len(x)):
x = 'a'
print(x)
|
||||||||
|
Answer:
Option (c) |
| 142. |
What will be the output of the following Python code snippet?
x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'
|
||||||||
|
Answer:
Option (d) |
| 143. |
What will be the output of the following Python code?
x = 123
for i in x:
print(i)
|
||||||||
|
Answer:
Option (c) |
| 144. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for i in d:
print(i)
|
||||||||
|
Answer:
Option (a) |
| 145. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d:
print(x, y)
|
||||||||
|
Answer:
Option (d) |
| 146. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items():
print(x, y)
|
||||||||
|
Answer:
Option (c) |
| 147. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys():
print(d[x])
|
||||||||
|
Answer:
Option (b) |
| 148. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(x)
|
||||||||
|
Answer:
Option (b) |
| 149. |
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(d[x])
|
||||||||
|
Answer:
Option (d) |
| 150. |
What will be the output of the following Python code?
d = {0, 1, 2}
for x in d.values():
print(x)
|
||||||||
|
Answer:
Option (c) |