Completed
Class 11 CS – For, While & Jump Statements Moderate Level
Questions From This Challenge
Q1mcq1 mark
What will be the output? total = 0 for i in range(1, 7): if i % 2 == 0: continue total += i print(total)
9 ✓
12
15
21
Q2mcq1 mark
What will be the output? for i in range(2, 8): if i == 5: break print(i, end=" ")
2 3 4 ✓
2 3 4 5
2 3 4 6 7
5 6 7
Q3mcq1 mark
What will be the output? i = 1 total = 0 while i <= 5: if i == 3: i += 1 continue total += i i += 1 print(total)
9
10
12 ✓
15
Q4mcq1 mark
Which statement correctly describes the following code? i = 1 while i <= 5: if i == 3: continue print(i) i += 1
It prints 1, 2, 4, 5 and terminates normally
It prints 1, 2 and then repeatedly reaches i = 3 ✓
It prints 1, 2, 3, 4, 5
It immediately terminates at i = 3
Q5mcq1 mark
What will be the output? for i in range(1, 6): if i == 2: pass elif i == 4: continue print(i, end=" ")
1 2 3 5 ✓
1 3 5
1 2 3 4 5
2 4
Q6mcq1 mark
What will be the output? i = 0 while i < 6: i += 1 if i % 2 == 0: continue if i == 5: break print(i, end=" ")
1 3 ✓
1 3 5
2 4
1 2 3 4
Q7mcq1 mark
What will be the output? total = 0 for i in range(1, 8): if i == 4: break if i % 2 == 0: continue total += i print(total)
3
4 ✓
6
9
Q8mcq1 mark
What will be the output? i = 1 while i <= 6: if i == 4: break i += 1 print(i)
3
4 ✓
5
6
Q9mcq1 mark
In the following code, what is the effect of continue? for i in range(1, 6): if i == 3: continue print(i)
The loop terminates when i becomes 3
Only the print statement is skipped for i = 3 ✓
The entire loop is skipped
i becomes 4 immediately and the loop terminates
Q10mcq1 mark
What will be the output? for i in range(1, 4): for j in range(1, 4): if j == 2: break print(j, end="")
123123123
111 ✓
121212
12
Q11output1 mark
What will be the output?
for i in range(1, 6):
if i == 3:
continue
print(i, end=" ")
Correct output:
1 2 4 5Q12output1 mark
What will be the output?
i = 1
while i <= 5:
if i == 4:
break
print(i, end=" ")
i += 1
Correct output:
1 2 3Q13output1 mark
What will be the output?
total = 0
for i in range(1, 6):
if i % 2 == 0:
continue
total += i
print(total)
Correct output:
9Q14output1 mark
What will be the output?
i = 1
while i <= 5:
i += 1
if i == 3:
continue
print(i, end=" ")
Correct output:
2 4 5 6Q15output1 mark
What will be the output?
for i in range(1, 4):
for j in range(1, 4):
if j == 2:
break
print(i, end="")
Correct output:
123