Code Writer
Level 3, 2026-05-18
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Use a loop to multiply the numbers from 1 to 31
Use: variables, loops[2]
|
|
|
|
Use a loop to print the average of the numbers from 0 to 5
Use: variables, loops[2]
|
|
|
|
Assume you have a list of numbers A. Write code to count how many numbers in the list are smaller than or equal to than 15
Use: variables, loops, if[3]
|
|
|
Test Using: A = [] A = [15,0,25] A = [9,83,24] |
Assume you have a non-empty list of numbers Z. Write code to find the smallest number in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Z = [1,2,3] Z = [3,2,1,0] Z = [98,43,69] |
Use a loop to print the sum of the numbers from 0 to 5
Use: variables, loops[2]
|
|
|
|
Assume you have two non-empty lists of numbers Q and X. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: Q = [1], X = [1] Q = [1,2,3], X = [3,2,1] Q = [17,31,61], X = [90,96,11] |
Print your first name
Use: [1]
|
|
|
|
Do the sum 29 + 94 and print the result
Use: [1]
|
|
|
|
Do the sum 22 - 31 in code and store the result
Use: variables[1]
|
|
|
|
|