3 MCQ Class 11th While and For Loops
3 MCQ Class 11th While and For Loops
: 9810301034
WHILE AND FOR LOOPS – 1
1. What is the output of the following?
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
a) [‘ab’, ‘cd’]. b) [‘AB’, ‘CD’]. c) [None, None]. d) none of the mentioned
2. What is the output of the following?
x = ['ab', 'cd']
for i in x:
x.append(i.upper())
print(x)
a) [‘AB’, ‘CD’]. b) [‘ab’, ‘cd’, ‘AB’, ‘CD’]. c) [‘ab’, ‘cd’]. d) none of the mentioned
3. What is the output of the following?
i=1
while True:
if i%3 == 0:
break
print(i)
i+=1
a) 1 2 b) 1 2 3 c) error d) none of the mentioned
4. What is the output of the following?
i=1
while True:
if i%0o7 == 0:
break
print(i)
i += 1
a) 1 2 3 4 5 6 b) 1 2 3 4 5 6 7 c) error d) none of the mentioned
5. What is the output of the following?
i=5
while True:
if i%0o11 == 0:
break
print(i)
i += 1
a) 5 6 7 8 9 10 b) 5 6 7 8 c) 5 6 d) error
6. What is the output of the following?
i=5
while True:
if i%0o9 == 0:
break
print(i)
i += 1
a) 5 6 7 8 b) 5 6 7 8 9 c) 5 6 7 8 9 10 11 12 13 14 15 …. d) error
7. What is the output of the following?
i=1
while True:
if i%2 == 0:
break
print(i)
i += 2