Code Writer
Level 3, 2026-05-10
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have a variable A. If A is bigger than 5 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: A = 0 A = 5 A = 10 |
Assume you have a variable Y. If Y is bigger than 5 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: Y = 0 Y = 5 Y = 10 |
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 = 12, T = 28 |
Assume you have a variable B. If B is smaller than 2 add 2 to it, otherwise subtract 9 from it
Use: variables, if[2]
|
|
|
Test Using: B = 0 B = 2 B = 10 |
A right angled triangle has 2 shorter sides of 8 and 3. Calculate the other side (the "hypotenuse").
Use: variables, sqrt()[2]
|
|
|
|
Print each number from 0 to 29
Use: loops[2]
|
|
|
|
Print your first name
Use: [1]
|
|
|
|
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 9 and another side of 7. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
|