Code Writer
Level 3, 2026-02-12
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
A right angled triangle has 2 shorter sides of 7 and 2. Calculate the other side (the "hypotenuse").

Use: variables, sqrt()[2]
Assume you have a list variable LIST. Count the number of items in LIST and print the result.

Use: loops, variables[2]

Test Using:
LIST = ['a','b','c']
LIST = [1,2,3,4,5,6]
LIST = []
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 13 and another side of 5. Calculate the length of the missing side.

Use: variables, sqrt()[2]
Assume you have a list variable LIST of numbers. Use a variable to add the items in the list

Use: variables, loops[2]

Test Using:
LIST = [1]
LIST = [1,2,3,4,5,6,7,8,9]
LIST = [44,81,58]
Assume you have a list of numbers Y. Write code to count the number of times the number 21 appears in the list.

Use: variables, loops, if[2]

Test Using:
Y = [21]
Y = [0,21,-1,21,99,21]
Y = [28,14,82]
Assume you have a list of numbers F. Print the 5th element of F.

Use: variables[1]

Test Using:
F = [1,2,3,4,5,6,7,8,9,10]
Assume you have two non-empty lists of numbers X and B. Create a new variable that is equal to the first element of each list added together.

Use: variables[1]

Test Using:
X = [1], B = [1]
X = [1,2,3], B = [3,2,1]
X = [83,44,41], B = [80,60,76]
Use a loop to multiply the numbers from 1 to 39

Use: variables, loops[2]
Set a variable to one value then change that value

Use: variables[1]