Completed

Python Loops & Conditions

Class 11 · Computer Science Sun, 23 Aug 2026 4:00 PM 30s / question 15 questions · 15 marks

Questions From This Challenge

Q1output1 mark
What will be the output of the following Python code?
x = 2

for i in range(1, 6):
    if i % 2 == 0:
        x = x + i
    else:
        x = x - 1

print(x)
Correct output: 5
Q2output1 mark
What will be the output of the following Python code?
count = 0

for ch in "COMPUTER":
    if ch in "AEIOU":
        count = count + 1
    else:
        count = count - 1

print(count)
Correct output: -2
Q3mcq1 mark
Which of the following range() expressions generates exactly the values 4, 7, 10, 13?
range(4, 13, 3)
range(4, 14, 3) ✓
range(4, 15, 3)
range(3, 14, 3)
Q4output1 mark
What will be the output of the following Python code?
total = 0

for i in range(2, 12, 2):
    if i % 3 == 0:
        total = total + i
    else:
        total = total - 1

print(total)
Correct output: 2
Q5mcq1 mark
Which of the following for loops executes exactly 7 times?
for i in range(1, 8):
for i in range(0, 14, 2): ✓
for i in range(2, 15, 2):
for i in range(14, 1, -2):
Q6output1 mark
What will be the output of the following Python code?
result = 1

for i in range(2, 8):
    if i % 3 == 0:
        result = result + i
    else:
        result = result - 1

print(result)
Correct output: 6
Q7output1 mark
What will be the output of the following Python code?
total = 0

for i in range(2, 9, 2):
    if i > 4:
        total = total + i
    else:
        total = total - i

print(total)
Correct output: 12
Q8mcq1 mark
Which of the following statements about range(10, 1, -3) is correct?
It generates 10, 7, 4, 1.
It generates 10, 7, 4. ✓
It generates 1, 4, 7, 10.
It generates 10, 8, 6, 4, 2.
Q9output1 mark
What will be the output of the following Python code?
count = 0

for i in range(1, 20):
    if i % 4 == 0 or i % 5 == 0:
        count = count + 1

print(count)
Correct output: 7
Q10mcq1 mark
Which of the following loops prints exactly 12, 9, 6, 3?
for i in range(12, 3, -3):
for i in range(12, 2, -3): ✓
for i in range(12, 1, -3):
for i in range(12, 0, -3):
Q11output1 mark
What will be the output of the following Python code?
total = 0

for num in [5, 8, 11, 14]:
    if num % 2 == 0:
        total = total + num
    else:
        total = total - 1

print(total)
Correct output: 20
Q12output1 mark
What will be the output of the following Python code?
x = 3

for i in range(2, 7):
    if i % 2 == 0:
        x = x * 2
    else:
        x = x + 1

print(x)
Correct output: 30
Q13output1 mark
What will be the output of the following Python code?
x = 0

for i in range(3, 10):
    if i % 2 == 0:
        x = x + i
    elif i % 3 == 0:
        x = x - i

print(x)
Correct output: 6
Q14output1 mark
What will be the output of the following Python code?
x = 5

for i in range(1, 5):
    if i % 2 == 0:
        x = x + i
    else:
        x = x * 2

print(x)
Correct output: 24
Q15mcq1 mark
Which of the following range() expressions generates exactly five values?
range(2, 12, 2)
range(10, 0, -2)
range(1, 10, 2) ✓
range(5, 15, 3)
Next Live Challenge
Mixed: Tuples + Dictionary + Modules
Class 11 · Computer Science 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...