Code Writer
Level 3, 2026-11-02
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 S that is the length of the side of a square. Calculate another variable that is equal to the perimeter of the square.
Use: variables[2]
|
|
|
Test Using: S = 89 |
Create a list containing 5 numbers
Use: variables[1]
|
|
|
|
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
Create a list containing 5 colors
Use: variables[1]
|
|
|
|
Assume you have a list of numbers F. Print the 7th element of F.
Use: variables[1]
|
|
|
Test Using: F = [1,2,3,4,5,6,7,8,9,10] |
Use a loop to add the numbers from 0 to 46
Use: variables, loops[2]
|
|
|
|
Assume you have a variable A. If A is smaller than 9 add 7 to it, otherwise subtract 4 from it
Use: variables, if[2]
|
|
|
Test Using: A = 0 A = 9 A = 10 |
Use a loop to create a string that has 19 "f" characters
Use: variables, loops[2]
|
|
|
|
Use a loop to add the numbers from 0 to 16
Use: variables, loops[2]
|
|
|
|
Print your first name
Use: [1]
|
|
|
|
|