1.Trace the code
2.loop logic
3.If/else reasoning
4.Debug the idea
5.Vocabulary & concepts
100

x = 5

y = 10

z = x + y

print(z)

15

100

in range(3)for i :

    print(i)

 0, 1, and 2

100

x = 5

if x > 3:

    print("Yes")

else:

    print("No")

yes

100

for i in range(5)

    print(i)

add the ":" otherwise the program won't 

100

What is a variable in programming?

A variable is a container used to store data values.

200

x = 3

y = 4

z = x * y

x = z + 2

print(x)

14

200

total = 0

for i in range(1, 5):

    total += i

print(total)

10

200

x = 10

y = 20

if x == y:

    print("Equal")

else:

    print("Not Equal")

not equal 

200

x = 10

if x = 5:

    print("Equal")

The operator, =, is used instead of ==

200

What does a loop do in a program?

A loop repeatedly runs a block of code while a condition is true or for a set number of times.

300

x = 2

y = 3

for i in range(1, 4):

    x += y

    y -= 1

print(x)

 The loop runs 3 times, starting with x = 2 and y = 3

300

sum = 0

for i in range(1, 6, 2):

    sum += i

print(sum)

9

300

x = 10

y = 3

if x % y == 1:

    print("Remainder is 1")

elif x % y == 2:

    print("Remainder is 2")

else:

    print("Remainder is 0 or greater than 2")

The remainder is 1.

300

total = 0

for i in range(1, 5):

total += i

print(total)

The third line isn’t indented properly.

300

What is the difference between = and == in Python?

= assigns a value to a variable, while == compares two values.