Code Writer
Level 3, 2026-08-09
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Print a variable that contains your first name

Use: variables[1]
A list contains numbers that are the amount of HP damage caused by a series of attacks. Your character starts with 195HP. 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 each number from 0 to 35

Use: loops[2]
Use a loop to print 19 lines with the numbers from 1 to 19 and each number times 16, separated by a commma. For example, line 1 would be "1, 16", line 2 would be "2, 32",etc.

Use: variables, loops, str()[2]
Use a loop to print a list of numbers, including a line number on each line

Use: variables, loops, str()[2]
Do the sum 93 - 80 and print the result

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

Use: variables[1]
A rectangle has sides of 8 and 3. Create variables for the sides of the shape and then calculate its perimeter

Use: variables[2]
Do the sum 86 - 30 in code and store the result

Use: variables[1]