Trace the Code
Loop Logic
If / Else Reasoning
Debug the Idea
Vocabulary & Concepts
100

x = 5

y = x + 3

print(y)

what is 8?

100

How many times does this loop print "Hello"?

for i in range(3):

    print("Hello")

what is 3?

100

What will be printed?

x = 10

if x > 5:

    print("Big")

else:

    print("Small")

what is "Big"?

100

for i in range(5)

    print(i)

Missing colon at the end of the for statement.

100

What is a variable?

A named place in memory to store data.

300

a = 2

b = 4

a = b

b = a + 3

print(a, b)

what is (4,7) ?

300

What is the final value of `count`?

count = 0

for i in range(1, 6):

    count += i

what is 15?

300

What is the output?

num = 7

if num % 2 == 0:

    print("Even")

else:

    print("Odd")

what is "odd" ?

300

x = 10

if x = 5:

    print("Five")

Uses `=` instead of `==` in the if condition.

300

What is a loop used for in programming?

To repeat a block of code multiple times.

500

def mystery(n):

    total = 0

    for i in range(1, n+1):

        if i % 2 == 0:

            total += i

    return total

what is 6?

500

What does this code print?

for i in range(2):

    for j in range(3):

        print(i + j)

what is 0,1,2,1,2,3 ? 

 

500

What does this code print?

a = 3

b = 5

if a > b:

    print("A")

elif a == b:

    print("Equal")

else:

    print("B")

what is "B" ?

500

def add(a, b):

    return a + b


print(add(2))

The function call is missing one argument.

500

What is the difference between a function and a loop?

A function is a reusable block of code that performs a specific task; a loop repeats code multiple times.

M
e
n
u