Code Writer
Level 3, 2026-04-14
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have a variable B. If B is smaller than 4 add 9 to it, otherwise subtract 3 from it

Use: variables, if[2]

Test Using:
B = 0
B = 4
B = 10
Use a loop to multiply the numbers from 6 to 20

Use: variables, loops[2]
Assume you have a list of numbers Q. Write code to add up the numbers in the list that are bigger than or equal to than 6

Use: variables, loops, if[3]

Test Using:
Q = []
Q = [5,6,7,8,9,10,11,12,13,14,15]
Q = [87,44,11]
Assume you have a non-empty list of numbers B. Create a new variable that is equal all the numbers in B multiplied together.

Use: variables, loops[2]

Test Using:
B = [1,1]
B = [1,2,3,4,5]
B = [56,75,24]
Use a loop to print the average of the numbers from 7 to 18

Use: variables, loops[2]
Write a loop that prints "moo" 26 times

Use: loops[2]
Assume you have a non-empty list of numbers Y. Write code to find the smallest number in the list.

Use: variables, loops, if[2]

Test Using:
Y = [1,2,3]
Y = [3,2,1,0]
Y = [5,6,22]