Functions
Variables
Looping
Conditionals
Lists
100

[Hint: definition]

function

What is ... a block of code that does one job?

100

[Hint: Definition]

variable

What is ... a box with a name that holds a value?

100

[Hint: Definition]

looping

What is ... when a computer executes (or runs) the same instructions (or commands or actions) over and over?

100

[Hint: Definition]

conditional

What is ... when a computer "makes a decision" depending on a condition or conditions?

100

# Hint: Definition. Not the output.

my_list = [1, 2, 3, "A", 5.1, True, [5, 6, 7]]

my_list[6] = "cat"

print(my_list)

# Output: [1, 2, 3, 'A', 5.1, True, 'cat']

What is ... a data structure that is ordered and mutable (i.e., a list)?


200

[Hint: Definition]

def

What is ... the Python keyword used to DEF-ine a function?

200

# Hint: The coding concept

egg = 3

Egg = 7

print(egg)

# Output: 3

What is ... case-sensitivity?

Or what is ... Python is a case-sensitive coding language?

200

# Hint: The output

for ham in range(5):

  print(ham)

What is ... 
0
1
2
3
4
?
200

# Hint: The output

egg = 5

if egg == 5:

    print("True")

What is ... True?

200

# Hint: The coding concept.

my_list = []

print(my_list)

# Output: []

What is ... the empty list?

300

[Hint: Definition]

return

What is ... the Python keyword used to code a return statement (or return statements) in a function (or method)?

300

# Hint: _____Error

5catsinthehouse = True

What is a ... SyntaxError?

300

# Hint: The coding concept.

# Not the output.

for ham in range(5):

   print(ham)

What is ... a for loop?
300

# Hint: The output

egg = 7

if egg == 5:

    print("True")

else:

    print("False")

What is ... False?

300

# Hint: The coding concept.

# Not the output.

my_list = ["A", "B", "C"]

for spam in my_list:

    print(spam)

What is ... looping through a list?

400

[Hint: This is an example of _____ vs. _____.]

def my_func(egg, spam): 

vs. 

my_func(5, 7)

What is ... the parameter vs. the argument?

Or what are ... parameters vs. arguments?

FYI: Parameters: egg and spam

       Arguments: 5 and 7

400

# Hint: The output. Read carefully.

egg = 7

spam = 5

egg, spam = spam, egg

print(egg)

print(spam)

What is ...
5
7
?
400

# Hint: The coding concept. Not the output.

egg = 0

while egg < 5:

  print(egg)

  egg += 1

What is ... a while loop?

400

# Hint: The output. Read carefully.

egg = 5

if egg == 5:

    print("Five")

elif egg == 1:

    print("One")

else:

    print("Not 1 or 5")

What is ... Five?

[FYI: The code was tested with JDoodle.]

400

# Hint: The output. Read carefully.

listA = [4, 5, 6]

listB = [1, 2, 3]

listC = listB + listA

print(listC)

What is ... [1, 2, 3, 4, 5, 6]?

Or what is ... 1, 2, 3, 4, 5, 6?

[FYI: The code was tested with JDoodle.]

500

[Hint: Definition]

recursion

What is ... when a function calls itself?

500

# Hint: The output. Read carefully.

egg = "eggs"

eggs = "egg"

ham = "ham"

spam = "spam"

ham = egg

ham = spam

print(ham)

What is ... spam?

500

# Hint: The coding concept. Not the output.

spam = 1

while spam > 0:

  print(spam)

  spam += 1

What is ... an infinite loop?

500

# Hint: The output. Check the code carefully.

beans = 21

spam = ""

if (beans % 3) == 0:

  spam += "Fizz"

if (beans % 5) == 0:

  spam += "Buzz"

if spam == "":

  print(beans)

else:

  print(spam)

What is ... Fizz?

500

my_list = ["A", "B", "C"]

print(my_list[-2])

# Output: B

# Hint: The coding concept. Not the output.

# Check the code carefully.

What is ... negative indexing?

Or what is ... the second to last (i.e., penultimate) item?

M
e
n
u