Code Writer
Level 3, 2026-07-04
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 9 to 21
Use: variables, loops[2]
|
|
|
|
Assume you have a non-empty list of numbers Q. Create a new variable that is equal all the numbers in Q multiplied together.
Use: variables, loops[2]
|
|
|
Test Using: Q = [1,1] Q = [1,2,3,4,5] Q = [94,32,51] |
A triangle has sides of 5, 5 and 3. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Write a loop that prints "error" 89 times
Use: loops[2]
|
|
|
|
Assume you have a list of numbers F. Write code to count how many numbers in the list are bigger than or equal to than 2
Use: variables, loops, if[3]
|
|
|
Test Using: F = [] F = [2,0,25] F = [54,34,59] |
Use a loop to print the average of the numbers from 0 to 3
Use: variables, loops[2]
|
|
|
|
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 13 and another side of 3. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
|