Code Writer
Level 3, 2026-09-29
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
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] |
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Create a list containing 5 numbers and then print each one
Use: variables, loops[2]
|
|
|
|
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Print each number from 8 to 14
Use: loops[2]
|
|
|
|
Create a list containing 4 fruit and then print each one
Use: variables, loops[2]
|
|
|
|
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 10 and another side of 7. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
Use a loop to print the sum of the numbers from 6 to 25
Use: variables, loops[2]
|
|
|
|
|