Code Writer
Level 3, 2026-05-27
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Use a loop to print 45 lines with the numbers from 1 to 45 and each number times 19, separated by a commma.
For example, line 1 would be "1, 19", line 2 would be "2, 38",etc.
Use: variables, loops, str()[2]
|
|
|
|
Create a list containing 3 animals
Use: variables[1]
|
|
|
|
Create a list containing 3 colors
Use: variables[1]
|
|
|
|
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
Do the sum 54 * 98 and print the result
Use: [1]
|
|
|
|
A triangle has sides of 6, 2 and 5. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Assume you have a list variable LIST. Print each value in LIST.
Use: loops[2]
|
|
|
Test Using: LIST = [1,2,3] LIST = ['a','b',0] LIST = [] |
Do the sum 62 * 95 and print the result
Use: [1]
|
|
|
|
Assume you have a list of numbers X. Write code to count the number of times the number 73 appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: X = [73] X = [0,73,-1,73,99,73] X = [4,85,14] |
Print your first name
Use: [1]
|
|
|
|
Assume you have a list of numbers X. Print the 10th element of X.
Use: variables[1]
|
|
|
Test Using: X = [1,2,3,4,5,6,7,8,9,10] |
|