Code Writer
Level 3, 2026-06-20
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Set two variables to different values then add them together

Use: variables[1]
Assume you have 2 variables S and T that are equal to the sides of a rectangle. Calculate another variable that is equal to the perimeter of the rectangle.

Use: variables[2]

Test Using:
S = 99, T = 36
Assume you have a list of names, Q. Write code to count the number of times the name "Julie" appears in the list.

Use: variables, loops, if[2]

Test Using:
Q = []
Q = ['Julie']
Q = ['Julie','Jenny','Missy','Julie']
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 = []
Assume you have a list variable LIST. Count the number of items in LIST.

Use: loops, variables[2]

Test Using:
LIST = ['a','b','c']
LIST = [1,2,3,4,5,6]
LIST = []
A list contains numbers that are the amount of HP damage caused by a series of attacks. Your character starts with 135HP. Write code that works out how much damage you have taken and prints "Dead" if you are killed.

Use: variables, loops, if[3]

Test Using:
attacks = [1]
attacks = [50,50,50]
attacks = [1,1,1]
Print a variable that contains your first name

Use: variables[1]
Set two variables to different strings then make a new variable that combines them with a "a" in between

Use: variables[1]
Print your first name

Use: [1]