Completed

Loops

Class 11 · Informatics Practices Fri, 9 Oct 2026 8:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

Q1mcq1 mark
Which loop is best suited when the number of iterations is known in advance, e.g., iterating over a range of numbers?
for loop ✓
while loop
if-else
elif chain
Q2mcq1 mark
What does `range(5)` generate when used in a for loop?
The sequence 0, 1, 2, 3, 4 ✓
The sequence 1, 2, 3, 4, 5
The sequence 0, 1, 2, 3, 4, 5
The single value 5
Q3mcq1 mark
Which loop repeats a block of statements as long as a given condition remains True, without necessarily knowing the number of iterations in advance?
while loop ✓
for loop
if statement
elif statement
Q4mcq1 mark
What is the risk if the condition in a while loop never becomes False?
The loop becomes an infinite loop ✓
The loop executes exactly once
Python automatically stops it after 10 iterations
It causes a SyntaxError
Q5mcq1 mark
What does `range(2, 10, 2)` produce?
2, 4, 6, 8 ✓
2, 4, 6, 8, 10
2, 3, 4, 5, 6, 7, 8, 9
0, 2, 4, 6, 8
Q6mcq1 mark
In a while loop, which part must eventually change to allow the loop to terminate?
The variable(s) tested in the loop's condition ✓
The name of the loop variable
The indentation level of the loop body
The order of print statements inside the loop
Q7output1 mark
What is the output of the following code?
total = 0
for i in range(1, 6):
    total = total + i
print(total)
Correct output: 15
Q8output1 mark
What is the output of the following code?
for i in range(0, 10, 3):
    print(i)
Correct output: 0 3 6 9
Q9output1 mark
What is the output of the following code?
n = 5
while n > 0:
    print(n)
    n = n - 1
Correct output: 5 4 3 2 1
Q10output1 mark
What is the output of the following code?
i = 1
total = 0
while i <= 4:
    total = total + i
    i = i + 1
print(total)
Correct output: 10
Q11output1 mark
What is the output of the following code?
word = "cat"
for ch in word:
    print(ch)
Correct output: c a t
Q12output1 mark
What is the output of the following code?
for i in range(10, 0, -2):
    print(i)
Correct output: 10 8 6 4 2
Q13output1 mark
What is the output of the following code?
for i in range(1, 3):
    for j in range(1, 3):
        print(i, j)
Correct output: 1 1 1 2 2 1 2 2
Q14output1 mark
What is the output of the following code?
num = 1
product = 1
while num <= 4:
    product = product * num
    num = num + 1
print(product)
Correct output: 24
Q15output1 mark
What is the output of the following code?
for i in range(1, 5):
    print(i * i)
Correct output: 1 4 9 16
Next Live Challenge
DQL — BETWEEN + Logical Operators
Class 11 · Informatics Practices Fri, 23 Oct 2026, 8:00 PM
View Live Challenges →

← Back to Live Challenge History · Practice MCQs

CodeBuddy
Hi there! 👋 I'm CodeBuddy, your KV Coders assistant.

To help me give you the most accurate answers, please select your class and subject below, or just type your question!
Buddy is typing...