Code Writer
Level 3, 2026-11-17
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Write a loop that prints "error" 83 times
Use: loops[2]
|
|
|
|
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 area of the rectangle.
Use: variables[2]
|
|
|
Test Using: S = 77, T = 38 |
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 10 and another side of 3. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Do the sum 27 * 85 in code and store the result
Use: variables[1]
|
|
|
|
Assume you have a variable Q. If Q is smaller than 2 add 9 to it, otherwise subtract 7 from it
Use: variables, if[2]
|
|
|
Test Using: Q = 0 Q = 2 Q = 10 |
Assume you have 2 lists of numbers with 10 elements each: B and Q. Add the 4th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: B = [1,2,3,...,10], Q = [1,2,3,...,10] |
Use a loop to add the numbers from 0 to 48
Use: variables, loops[2]
|
|
|
|
Set two variables to different strings then make a new variable that combines them with a "F" in between
Use: variables[1]
|
|
|
|
|