CATEGORY 1: Trace the Code
CATEGORY 2: Loop Logic
CATEGORY 3: If / Else Reasoning
CATEGORY 4: Debug the Idea
CATEGORY 5: Vocabulary & Concepts
100

x = 10

x = x + 5

print(x);   What is the output?

15 is the right answer


100

for i in range(3):

    print(i)

0, 1, 2

100

x = 7

if x > 5:

    print("Greater")

else:

    print("Smaller")

It would be greater

100

x = 3

y = 5

if x > y:

    print("x is greater")

else:

    print("y is greater")

Nothings wrong

100

What is a variable

A variable holds value

200

a = 3

b = 4

a = a * b

b = a - b

print(b):   What is the final value of b?

8

200

total = 0

for i in range(1, 6):

    total += i

print(total)

15

200

x = 8

if x % 2 == 0:

    print("Even")

else:

    print("Odd")

It would be even

200

x = 4

if x = 4:

    print("Equal")

= is used instead of ==

200

What does a loop do?

A loop repeats the code

300

x = 5

y = 3

x = x * y 

y = x + y

x = x - y

print(x)

-3

300

total = 0

for i in range(2, 11, 2):

    total += i

print(total)

30

300

x = 4

y = 7

if x < y:

    if x % 2 == 0:

        print("Even")

    else:

        print("Odd")

else:

    print("Not even")

It would be even

300

x = 5

y = 2

if x > y:

print("x is bigger")

the line of code for print is not spaced correctly

300

What is the purpose of an if statement?

It makes decisions in a program.

M
e
n
u