While Loops
For Loops
Lists
Functions
If Statements
100

What is the syntax for a while loop?

while condition:

    print(xyz)

    break

100

What are for loops commonly used for?

What is repeating something a set number of times?

100

This symbol is used to create a list in Python.

What are square brackets [] ?

100

This keyword is used to define a function.

What is def?

100

This keyword is used to check an alternative condition.

What is elif?

200

 This keyword is used inside a while loop to immediately stop it.

What is break?

200

The condition “for i in range(3)” will print how many numbers?

What is 3 (0, 1, 2)?

200

The index of the first element in a Python list.

What is 0?

200

This keyword sends a value back from a function?

What is return?

200

This condition will run if no previous condition were True.

What is else?

300

This logic error happens when a while loop’s condition never becomes false.

What is an infinite loop?

300

What is the output of this code?:

for i in range(1, 5):

     print(i * 2)

What is 2, 4, 6, 8?

300

What does the .append method do to a list?

What is adds numbers or characters to the end of a list?

300

In def greet(name):, name is called this.

What is a parameter?

300

What is == used for in an if statement?

What is comparing two values for equality?

400

In “while x < 10” this must happen inside the loop to avoid an infinite loop.

What is updating (incrementing) the variable x?

400

What is the value of sum after this code runs?:

sum = 0

for i in range(1,4):

    sum +=1

What is 6?

(1 + 2 + 3 = 6)

400

What does the len(my_list) method return?

What is the length of my_list?
400

What is the output of this code?:

def mystery(x):

     return x * 2

print(mystery(3) + mystery(4))

What is 14?

400

What is printed?

x = 7

y = 3

if x > 5 and y < 5:

    print(“Yes”)

else:

    print(“No”)

What is “Yes”?

500

What is the outcome of this code and count’s value after running?: 

count = 0

while count <= 5:

     if count < 0:

           print(“Negative number”)

     else

           print(“ “)

     count+=1

6 blank lines are printed, and count = 6

500

How many times does this code run?

total = 0

for i in range(3):

    for j in range(2):

         total += 1

print(total)

What is 6?

500

What is x? (PseudoCode):

list = [1, 0, 4, 2]

x = -1

for EACH item IN list:

    if item > x:

        x = item

DISPLAY x

What is x = 2?

500

What is printed when this code runs?

def change(num):

    num +=5

    return num

x = 10

change(x)

print(x)

What is 10?

The function changes a copy of x, not the original variable.

500

What is printed?

score = 85

if score >= 90:

    print(“A”)

elif score >= 80:

    print(“B”)

elif score >= 70:

    print(“C”)

else:

    print(“F”)

What is “B”?