Code Writer
Level 3, 2026-06-01
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 71 * 98 and print the result
Use: [1]
|
|
|
|
Assume you have a list of numbers B. Write code to count how many numbers in the list are bigger than or equal to than 10
Use: variables, loops, if[3]
|
|
|
Test Using: B = [] B = [10,0,25] B = [69,90,31] |
Assume you have a list of names, A. Write code to count the number of times the name "Jenny" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: A = [] A = ['Jenny'] A = ['Jenny','Mike','Flip','Jenny'] |
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 = [] |
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Do the sum 35 / 53 and print the result
Use: [1]
|
|
|
|
Do the sum 25 / 89 in code and store the result
Use: variables[1]
|
|
|
|
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
Assume you have a non-empty list of numbers VAR. Create a new variable that is equal all the numbers in VAR multiplied together.
Use: variables, loops[2]
|
|
|
Test Using: VAR = [1,1] VAR = [1,2,3,4,5] VAR = [96,21,72] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
|