Code Writer
Level 3, 2026-08-05
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
A triangle has sides of 8, 9 and 4. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Use a loop to add the numbers from 0 to 53
Use: variables, loops[2]
|
|
|
|
Assume you have a list of numbers Q. Print the 4th element of Q.
Use: variables[1]
|
|
|
Test Using: Q = [1,2,3,4,5,6,7,8,9,10] |
Assume you have a non-empty list of scores Q for your math class. Calculate the average of the scores.
Use: variables, loops[3]
|
|
|
Test Using: Q = [10] Q = [1,2,3,4,5] Q = [86,43,62] |
Assume you have a list of numbers E. Create a new variable that is equal to sum of all the numbers in E.
Use: variables, loops[2]
|
|
|
Test Using: E = [] E = [1,1] E = [5,35,100] |
Use a loop to print the average of the numbers from 9 to 20
Use: variables, loops[2]
|
|
|
|
Use a loop to print the sum of the numbers from 5 to 25
Use: variables, loops[2]
|
|
|
|
Do the sum 48 * 49 in code and store the result
Use: variables[1]
|
|
|
|
|