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

What is needed to Trace the code?

A way to track the variable change

100

What are the outputs for:

for i in range(1, 6):

    print(i)

1

2

3

4

5

100

Why do we use if/else reasoning?

It is a conditional statement

100

what is wrong with this

name = input(what is your name? )

print("Hello", name)

In line 1 the quotations are missing

100

What coding language are we using to code in this class?

Python

200

What is this code tracing?

for i in range(4,25):

    if i  % 2 == 0:

        print("Even")

    else:

        print("Odd")

It is tracing if numbers 4-24 is Odd or Even

200

What would be the total

total = 0


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

    total += i


print(total)

12

200

If the budget was 250 what would it print out? 

budget = 200


if budget >= 250:

    print("You may go to the mall")

else:

    print("Save up")

You may go to the mall

200

What is wrong with this:

age = (input("What is your age"))


if age < 13:

    print("Child")

elif age < 18:

    print("Teen")

else:

    "Adult"

Line 1 missing “Int()” to turn string into integer and line 8 missing “print()”

200

What is a “code”

Code is a set of instructions written in a programming language that tells a computer what to do


300

What is missing?

for i in range(3,24):

    print()

    if i < 10:

        print("Small")

    else:

    print("Big")

Line 2 is missing what to print and line 6 has no indentation after the “Else:”

300

What would the final count be?

count = 0


for i in range(1, 6):

    if i % 2 == 0:

        count += i

    else:

        count -= 1


print(count)

3

300

What would be considered “Premium meal” 

food = input("Choose a food option (1–4): ")

extras = input("Do you want extras? (yes/no): ")


if food == "3" or food == "4":

    if extras == "yes":

        print("Premium meal with extras selected")

    else:

        print("Premium meal")


if food == "1" or food == "2":

    if extras == "yes":

        print("Standard meal with extras")

    else:

        print("Standard meal without extras")

3 or 4 and no

300

What is wrong with this:

time = input("What time is it?: ")

day = input("What day is it today?: ")


if day == "saturday" or day == "sunday"

Line 1 missing “int()” and its missing a “:” in line 4

300

Why do we need code in computers?

We need code to tell computers how to work and what tasks to perform.

M
e
n
u