Trace the code
Loop logic
if/else reasoning
Debug the idea
Vocab & Concepts
100

x = 5

y = x + 2

print(y)

7

100

for i in range(3):

    print(i)

0

1

2
100

x = 10

if x > 5:

    print("High")

else:

    print("Low")

High

100

print("Hello)

Closing quotation mark is missing 

100

What is a variable??

A variable stores data that can be used and changed in a program


200

num = 3

num = num * 2

num = num + 4

print(num)

10

200

total = 0

for i in range(1, 4):

    total += i

print(total)

6

200

num = 7

if num % 2 == 0:

    print("Even")

else:

    print("Odd")

Odd

200

for i in range(5)

    print(i)

Colon is missing after for statement 

200

What does a loop do in a program??

A loop repeats a block of code multiple times


300

a = 4

b = a

a = a + 3

print(b)

4

300

total = 0

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

    total += i

print(total)

20

300

score = 85

if score >= 90:

    print("A")

elif score >= 80:

    print("B")

else:

    print("C")

B

300

num = "5"

print(num + 2)

Mixing string with an integer 

300

What’s the difference between = and == in python??

= assigns a value, while == checks if two values are equal