Completed

Mixed: conditionals + loops

Class 11 · Computer Science Tue, 13 Oct 2026 8:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

Q1mcq1 mark
What is the output of the following code? n = 5 fact = 1 i = 1 while i <= n: fact = fact * i i += 1 print(fact)
120 ✓
24
60
720
Q2mcq1 mark
What is the output of the following code? total = 0 for i in range(1, 11): if i % 2 == 0: total += i if total > 25: print("High") else: print("Low")
High ✓
Low
Error
30
Q3mcq1 mark
What is the output of the following code? n = 9 count = 0 for i in range(1, n + 1): if n % i == 0: count += 1 if count == 2: print("Prime") else: print("NotPrime")
Prime
NotPrime ✓
Error
9
Q4mcq1 mark
What is the output of the following code? n = 1 while True: if n % 3 == 0 and n % 4 == 0: break n += 1 print(n)
12 ✓
6
24
4
Q5mcq1 mark
What is the output of the following code? target = 7 count = 0 for i in range(1, 6): for j in range(1, 6): if i + j == target: count += 1 print(count)
4 ✓
3
5
6
Q6output1 mark
What is the output?
n = 1
total = 0
while n <= 50:
    total += n
    if total > 30:
        break
    n += 1
print(total)
Correct output: 36
Q7output1 mark
What is the output?
pos = 0
neg = 0
zero = 0
nums_total = 0
for i in range(-3, 4):
    nums_total += 1
    if i > 0:
        pos += 1
    elif i < 0:
        neg += 1
    else:
        zero += 1
print(pos)
print(neg)
print(zero)
Correct output: 3 3 1
Q8output1 mark
What is the output?
for i in range(1, 4):
    row_sum = 0
    for j in range(1, i + 1):
        row_sum += j
    print(row_sum)
Correct output: 1 3 6
Q9output1 mark
What is the output?
n = 6
i = 1
fact = 1
while i <= n:
    fact = fact * i
    if fact > 100:
        break
    i += 1
print(fact)
Correct output: 120
Q10output1 mark
What is the output?
total = 0
for i in range(1, 4):
    for j in range(1, 4):
        if i == j:
            continue
        total += i * j
print(total)
Correct output: 22
Q11output1 mark
What is the output?
for i in range(1, 11):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)
Correct output: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz
Q12output1 mark
What is the output?
total = 0
for i in range(1, 6):
    for j in range(1, i + 1):
        total += j
    if total > 15:
        break
print(total)
Correct output: 20
Q13output1 mark
What is the output?
num = 2
product = 1
count = 0
while count < 10:
    product = product * num
    count += 1
    if product > 50:
        break
print(product)
print(count)
Correct output: 64 6
Q14output1 mark
What is the output?
total = 0
for i in range(1, 7):
    for j in range(1, 7):
        if i == j:
            continue
        if i * j % 2 == 0:
            continue
        total += i * j
        if total > 20:
            break
print(total)
Correct output: 31
Q15output1 mark
What is the output?
n = 99
while n > 0:
    if n % 6 == 0 and n % 8 == 0:
        break
    n -= 1
print(n)
Correct output: 96
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...