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(9)” will print how many numbers?

What is 9 (0, 1, 2, 3, 4, 5, 6, 7, 8)?

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, 10):

     print(i * 2)

What is

2

4

6

8

10

12

14

16

18?

300

What does the .insert method do to a list?

What is inserts a value at the specified index?

300

How would you call a method named: 

def greet(name):

What is " greet("John") " ?

300

What is == used for in an if statement?

What is comparing two values for equality?

400

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

What is updating (decrementing) the variable x?

400

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

sum = 0

for i in range(0,4):

    sum +=1

What is 4?

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 1?

400

What is printed?

x = 6

y = 4

if x > 3 and y < 2:

    print(“Yes”)

else:

    print(“No”)

What is “No”?

500

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

count = 0

while count <= 3:

     if count < 0:

           print(“Negative number”)

     else

           print(“One“)

     count+=1

What is

One

One

One

One

count = 4 ?

500

How many times does this code run?

total = 0

for i in range(28):

    for j in range(3):

         total += 1

print(total)

What is 84?

500

What is x? (PseudoCode):

list = [1, 0, -6, 4, -1, 5, 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*2/1)

    return num

x = 10

change(x)

print(x)

What is 10?

The function changes a copy of x, not the original variable. While x's value changes inside the function, the returned value is not stored anywhere, hence print(x) prints the original value of x.

500

The Output:

x = 7

if x > 10:

    print("A")

elif x > 5:

    if x < 8:

        print("B")

    else:

        print("C")

else:

    print("D")

What is “B”?

M
e
n
u