Code Writer
Level 3, 2026-11-23
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Use a loop to print the average of the numbers from 4 to 18
Use: variables, loops[2]
|
|
|
|
A list contains numbers that are the amount of HP damage caused by a series of attacks. Your character starts with 108HP. 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] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Use a loop to create a string that has 26 "b" characters
Use: variables, loops[2]
|
|
|
|
Create a list containing 4 fruit
Use: variables[1]
|
|
|
|
Assume you have a list of numbers Y. Print the 10th element of Y.
Use: variables[1]
|
|
|
Test Using: Y = [1,2,3,4,5,6,7,8,9,10] |
Print each number from 0 to 37
Use: loops[2]
|
|
|
|
Use a loop to create a string that has 15 "C" characters
Use: variables, loops[2]
|
|
|
|
Create a list containing 2 fruit
Use: variables[1]
|
|
|
|
|