Code Writer
Level 3, 2026-04-20
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 area of the rectangle.
Use: variables[2]
|
|
|
Test Using: S = 94, T = 18 |
A triangle has sides of 4, 3 and 4. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Assume you have a non-empty list of numbers Z. Create a new variable that is equal all the numbers in Z multiplied together.
Use: variables, loops[2]
|
|
|
Test Using: Z = [1,1] Z = [1,2,3,4,5] Z = [90,34,53] |
Assume you have 2 lists of numbers with 19 elements each: Z and E. Add the 10th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: Z = [1,2,3,...,19], E = [1,2,3,...,19] |
Use a loop to print a list of numbers, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Use a loop to multiply the numbers from 7 to 19
Use: variables, loops[2]
|
|
|
|
Use a loop to multiply the numbers from 1 to 31
Use: variables, loops[2]
|
|
|
|
Use a loop to create a string that has 22 "C" characters
Use: variables, loops[2]
|
|
|
|
|