Completed
Class 11 CS – Jump Statements
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 if total > 5: break print(total)
6
9 ✓
10
15
Q2mcq1 mark
What will be the output? for i in range(1, 7): if i == 2: continue if i == 5: break print(i, end=" ")
1 2 3 4
1 3 4 ✓
1 3 4 5
1 2 3 4 5
Q3mcq1 mark
What will be the output? x = 0 for i in range(1, 6): if i == 3: pass else: x += i print(x)
12 ✓
15
9
8
Q4mcq1 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
Q5mcq1 mark
Consider the following code: for i in range(1, 5): if i == 2: pass elif i == 3: continue print(i, end=" ") Which statement correctly describes the execution?
Only 2 is skipped
2 is printed and 3 is skipped ✓
Both 2 and 3 are skipped
The loop stops when i becomes 3
Q6mcq1 mark
What will be the output? x = 1 for i in range(1, 5): if i == 3: continue x *= i print(x)
6
8 ✓
12
24
Q7mcq1 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
Q8mcq1 mark
What will be the output? n = 1 while n <= 6: if n == 4: n += 1 continue if n == 6: break n += 1 print(n)
4
5
6 ✓
7
Q9mcq1 mark
What will be the output? total = 0 for i in range(1, 6): if i == 2: continue if i == 4: break total += i print(total)
4 ✓
6
8
10
Q10mcq1 mark
Which change would make the following loop terminate correctly instead of repeatedly reaching the same value of i? i = 1 while i <= 5: if i == 3: continue print(i) i += 1
Replace continue with break
Add i += 1 before continue ✓
Replace continue with pass
Remove the if statement
Q11output1 mark
What will be the output?
for i in range(1, 6):
if i % 2 == 0:
continue
print(i, end=" ")
Correct output:
1 3 5Q12output1 mark
What will be the output?
total = 0
for i in range(1, 6):
if i == 3:
continue
total += i
print(total)
Correct output:
12Q13output1 mark
What will be the output?
for i in range(1, 5):
if i == 2:
pass
elif i == 3:
break
print(i, end=" ")
Correct output:
1 2Q14output1 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