Completed

Class 11 CS – Advanced Conditional & Loop Challenge

Class 11 · Computer Science Fri, 18 Sep 2026 9:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

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

if x % 3 == 0:
    x = x + 4

if x % 2 == 0:
    x = x * 2
else:
    x = x - 3

print(x)
Correct output: 16
Q2output1 mark
What will be the output of the following Python code?
n = 17

if n > 10:
    n = n - 5
elif n > 5:
    n = n + 5
else:
    n = n * 2

print(n)
Correct output: 12
Q3output1 mark
What will be the output of the following Python code?
x = 20

if x > 10:
    x = x - 7

if x > 15:
    x = x + 3
elif x > 10:
    x = x - 3
else:
    x = x * 2

print(x)
Correct output: 10
Q4output1 mark
What will be the output of the following Python code?
n = 30

if n % 2 == 0:
    print("A")
elif n % 3 == 0:
    print("B")
else:
    print("C")

if n % 5 == 0:
    print("D")
else:
    print("E")
Correct output: A D
Q5output1 mark
What will be the output of the following Python code?
marks = 68

if marks >= 80:
    grade = "A"
elif marks >= 60:
    grade = "B"
elif marks >= 40:
    grade = "C"
else:
    grade = "D"

print(grade)
Correct output: B
Q6output1 mark
What will be the output of the following Python code?
total = 0

for i in [2, 5, 8, 11]:
    if i > 5:
        total = total + i
    else:
        total = total - i

print(total)
Correct output: 12
Q7output1 mark
What will be the output of the following Python code?
x = 1

for i in [3, 5, 7]:
    x = x + i
    if x > 8:
        x = x - 2

print(x)
Correct output: 12
Q8output1 mark
What will be the output of the following Python code?
total = 0

for i in [4, 7, 10, 13]:
    if i % 2 == 0:
        total += i
    else:
        total -= i

print(total)
Correct output: -6
Q9output1 mark
What will be the output of the following Python code?
n = 16
count = 0

while n > 1:
    n = n // 2
    count += 1

print(count, n)
Correct output: 4 1
Q10output1 mark
What will be the output of the following Python code?
x = 5
total = 0

while x < 15:
    total += x
    x += 3

print(total, x)
Correct output: 38 17
Q11output1 mark
What will be the output of the following Python code?
n = 25
total = 0

while n > 5:
    if n % 2 == 0:
        total += n
    else:
        total -= n
    n -= 4

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

while x < 30:
    if x % 3 == 0:
        x = x + 4
    else:
        x = x + 5

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

for i in [1, 2, 3, 4, 5]:
    if i % 2 == 0:
        total = total + i * 2
    else:
        total = total + i

print(total)
Correct output: 21
Q14output1 mark
What will be the output of the following Python code?
x = 10

if x >= 10:
    x = x - 4

if x >= 8:
    x = x + 5
elif x >= 5:
    x = x + 2
else:
    x = x * 2

print(x)
Correct output: 8
Q15output1 mark
What will be the output of the following Python code?
n = 3
total = 0

while n <= 15:
    if n % 3 == 0:
        total += n
    else:
        total -= n
    n += 2

print(total, n)
Correct output: 63 17
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...