Code Writer
Level 3, 2026-09-24
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 non-empty list A. Print the first element in the list.

Use: variables[1]

Test Using:
A = [1]
A = ['b','a','c']
A = [2,44,14]
Assume you have a list of numbers VAR. Write code to count how many numbers in the list are smaller than 20

Use: variables, loops, if[3]

Test Using:
VAR = []
VAR = [20,0,25]
VAR = [28,19,43]
Use a loop to create a string that has 25 "g" characters

Use: variables, loops[2]
Create a list containing 4 animals and then print each one

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

Use: variables[1]
A factorial of a number is all the numbers from 1 to that number multiplied together, so 4! = 1x2x3x4. Write code using a loop to calculate 43!

Use: variables, loops, str()[2]
Assume you have a variable S that is the length of the side of a square. Calculate another variable that is equal to the area of the square.

Use: variables[2]

Test Using:
S = 21
Print your first name

Use: [1]
Assume you have a list of numbers B. Print the 4th element of B.

Use: variables[1]

Test Using:
B = [1,2,3,4,5,6,7,8,9,10]