Trivia
Debugging
Conditionals
While Loops
Functions
100

What is the name of the programming language we are learning?

Python.

100

if answer = "yes":

   print("The answer was yes")

you need two equal signs

100

num = 5

if num < 10:

    print("Test 1")

Test 1

100

What does this code print?

num = 0

while num <= 4:

   print(num)

   num = num + 1

0

1

2

3

4

100

What does this function do?

def mystery():   

answer = input("What is your name?")   

print("Hello, " + answer)

Asks the user for their name and then prints a greeting using their input

200

What sport does Maeve play?

Lacrosse

200

What is wrong with this code?

answer == "yes"

if answer == "yes"

print("The answer was yes")

if answer == "no"

print("The answer was no")

The first line should read answer = "yes"
200

num = 2

if num > 5:

   print("Test 1")

elif num < 3:

   print("Test 2")

Test 2

200

What does this code print?

num = 5

while num > 0:

   print(num)

   num = num - 1

5

4

3

2

1

200

define a function named square

def square():

300

How many cats does Celia have?

2

300
What is wrong with this code?


if answer == "10"

   print("The answer was 10")

you need a colon at the end of the line

300

num = 10

if num < 15:

  print("Test 1")

if num == 10:

  print("Test 2")

Test 1

Test 2

300

Write code to make the user try again if their input is not yes or no

answer = input("Type yes or no")

while answer != "yes" and answer != "no":

  answer = input("Try again. Type yes or no")

300
List three important characteristics of functions.

Reusability, indentation, parenthesis (parameters/arguments, colons, organization.

400

What happens when you back away from the tornado in Celia's Tornado Twisters game?

It starts raining cheese

400

What is wrong with this code?

def favorite color():

   answer = input("What is your favorite color?")

   print("That is a good favorite color")


favorite color cannot be two words it has to be either favoriteColor or favorite_color

400

num = 9

if num == 10:

  print("Test 1")

elif num == 8:

  print("Test 2")

elif num == 7:

   print("Test 3")

else

  print("Test 4")

Test 4

400

num = 5

while num == 5:

   print(num)

will print 5 forever

400

Write a function that asks the user how old they are and figures out when they were born.

def age():

   answer = input("How old are you?")

   yearBorn = 2024-answer

  print("You were born in " + yearBorn)

500

What does IDE stand for?

Integrated development environment.

500

What is wrong with this code?

hello()

def hello():

   print("Hello")

You have to define the function before you call it

500

Write code to make the user input a number. If the number is less than 5 print "Less than 5" if the number is greater than 5 print "greater than 5" and if the number is equal to 5 print "it is 5"

num = input("Pick a number")

if num < 5:

  print("less than 5")

elif num > 5

   print("greater than 5")

elif num == 5:

   print("it is 5")

500

Write code to use a while loop to count from 0 to 10 by twos.

num = 0

while num <=10:

   print(num)

   num = num + 2

500

Make a function that asks for the user's favorite food and prints it three times. 

def food():

     answer = input("What is your favorite food?")

     i = 0

     while (i < 3):

          print(answer)