Code Writer
Level 3, 2026-07-23
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 list variable LIST of numbers. Use a variable to add the items in the list
Use: variables, loops[2]
|
|
|
Test Using: LIST = [1] LIST = [1,2,3,4,5,6,7,8,9] LIST = [83,53,71] |
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 = 24 |
Assume you have a list of numbers X. Print the 5th element of X.
Use: variables[1]
|
|
|
Test Using: X = [1,2,3,4,5,6,7,8,9,10] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Assume you have a non-empty list of numbers B. Create a new variable that is equal all the numbers in B multiplied together.
Use: variables, loops[2]
|
|
|
Test Using: B = [1,1] B = [1,2,3,4,5] B = [45,19,54] |
Create a list containing 3 numbers
Use: variables[1]
|
|
|
|
Use a loop to add the numbers from 0 to 39
Use: variables, loops[2]
|
|
|
|
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Print each number from 6 to 9
Use: loops[2]
|
|
|
|
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
|