Python Fundamentals
Numbers and Arithmetic
Booleans and Conditionals
Loops
Miscellaneous
100

This symbol denotes a multi-line comment in Python:

What is a triple quote (""")?

100

The name of the // operator:

What is floor/int divison? 

100

The symbol used after an IF/ELIF/ELSE statement:

What is a colon (:)?

100

This type of loop runs exactly X times:

What is a FOR loop?

100

The function used to determine the # of seconds that have passed since Jan. 1, 1970 (epoch time):

What is time.time()?

200

This data type has a very wide range of possible values but can't perfectly represent every value within that range:

What is a float?

200

The number this code prints out:

x = 10

y = 13

print(x ** 2 + y % 5)

What is 103?

200

The number of ELIFs which can be paired with an IF:

What is infinite?

200

This type of loop runs between 0 and ∞ times:

What is a WHILE loop?

200

The kind of error this code generates:

x = 100

y = 0

print(x % y)

What is a runtime error?

300

The data type we get back from the input() function:

What is a string?

300

The number this code prints out:

x = 25

y = 3

print((x // y) * y + x % y)

What is 25?

300

Everything that prints out in this code:

x = 17
if 42 > 29 and 17 == x:
    print("Hello!")
elif 7 < x and x < 222:
    print("Whoa there")
print("Okay byeeeee")

What is "Hello!\nOkay byeeeee"?

300

The number of times this code prints "Hello!":

i = 0

while i < 10:

____i += 3

____for j in range(5):

________print("Hello!")

What is 20?

300

The way to generate a random float between 0.0 (inclusive) and 42.0 (exclusive)

What is random.random() * 42?

400

Everything that prints out in this program:

food = input("Name: ") # the user inputs 'kevin'

thing = input("Food: ") # the user inputs 'tacos'

name = input("Thing: ") # the user inputs 'lego ninjago'

print("Your name is " + thing + " and you like to eat " + name + " and you like to use " + food)

What is "Your name is tacos and you like to eat lego ninjago and you like to use kevin"?

400

The number this code prints out:

a = 1200

b = 15

c = 5

print((a % c) * b + a / 6)

What is 200?

400

Everything that prints out in this code:

loaves = 15 // 7
eggs = 45 % 30
if loaves == 2 and eggs == 24:
    print("I guess you win")
elif loaves == 2:
    print("all ur good at is bread tho")
elif eggs == 24:
    print("you smell of elderberries")
print("Thanks for playing Rachel simulator!")

What is "all ur good at is bread tho\nThanks for playing Rachel simulator!"?

400

The number of times this code prints "Hello!":

for i in range(5):

____for j in range(i):

________print("Hello!")

What is 10?

400

The output of this code

import random

random.seed(1)
choice = random.randint(1, 3)
if choice == 1:
____print("Eagles win!!!")
elif choice == 2:
____print("Go  Chiefs!!!")
else:
____print("Neither, the commercials are OP")

What is "Eagles win!!!"?

500

The output of this code:

"""#print("yellow")
print("orange")
print("red")#"""
print("magenta")
"""#""""""print("blue")"""
print("purple")
print("green")
""""""

What is "magenta\npurple\ngreen"?

500

The number this code prints out:

from math import sqrt

x1 = 0

y1 = 0

x2 = 3

y2 = 4

print(sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2))

What is 5?

500

Everything that prints out in this code:


print("heh heh heh")

if 3 < 20 and not (13 != 14) or 4 > 4:

____print("Hello, World!")

elif "what" == "what" and "Yellow" == "yellow":

____print("Okay")

elif 0 = 0.0:

____print("What an anticlimax")

print("What an anticlimax")

What is "Yepperz\nWhat an anticlimax\nWhat an anticlimax"?

500

The number of times this code prints "Hello!":

for i in range(1, 7):

____for j in range(1, i):

________if i % j == 0:

____________print("Hello!")

What is 8?

500

The code to make turtle draw a square

(assume you directly import all needed functions as opposed to saying 'import turtle')

What is "forward left forward left forward left forward left"?

Alternatively, could use right instead of left

M
e
n
u