Code Writer
Level 3, 2026-03-12
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
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 perimeter of the rectangle.
Use: variables[2]
|
|
|
Test Using: S = 12, T = 53 |
Use a loop to print the average of the numbers from 8 to 20
Use: variables, loops[2]
|
|
|
|
Create a list containing 4 numbers and then print each one
Use: variables, loops[2]
|
|
|
|
Print each number from 4 to 18
Use: loops[2]
|
|
|
|
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Use a loop to print the average of the numbers from 0 to 7
Use: variables, loops[2]
|
|
|
|
Assume you have a variable S that is the length of the side of a square. Calculate another variable that is equal to the area of the square.
Use: variables[2]
|
|
|
Test Using: S = 63 |
Create a list containing 4 animals
Use: variables[1]
|
|
|
|
Assume you have 2 lists of numbers with 14 elements each: F and Z. Add the 6th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: F = [1,2,3,...,14], Z = [1,2,3,...,14] |
|