Looping
1.
What will be the output of the following Python code?
x = ['ab', 'cd']
for i in x:
i.upper()
print(x) 2.
What will be the output of the following Python code?
x = ['ab', 'cd']
for i in x:
x.append(i.upper())
print(x) 3.
What will be the output of the following Python code?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1 4.
What will be the output of the following Python code?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1 5.
What will be the output of the following Python code?
i = 5
while True:
if i%0O11 == 0:
break
print(i)
i += 1 6.
What will be the output of the following Python code?
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2 7.
What will be the output of the following Python code?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2 8.
What will be the output of the following Python code?
i = 1
while False:
if i%2 == 0:
break
print(i)
i += 2 9.
What will be the output of the following Python code?
True = False
while True:
print(True)
break 10.
What will be the output of the following Python code?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)