Code Writer
Level 3, 2026-05-14
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 of numbers VAR. Write code to count how many numbers in the list are bigger than or equal to than 12
Use: variables, loops, if[3]
|
|
|
Test Using: VAR = [] VAR = [12,0,25] VAR = [83,56,28] |
Assume you have a list of names, E. Write code to count the number of times the name "Felix" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: E = [] E = ['Felix'] E = ['Felix','Julie','Edward','Felix'] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Assume you have a list of numbers A. Write code to add up the numbers in the list that are bigger than 6
Use: variables, loops, if[3]
|
|
|
Test Using: A = [] A = [5,6,7,8,9,10,11,12,13,14,15] A = [93,95,53] |
A factorial of a number is all the numbers from 1 to that number multiplied together, so 4! = 1x2x3x4. Write code using a loop to calculate 77!
Use: variables, loops, str()[2]
|
|
|
|
Do the sum 24 - 64 and print the result
Use: [1]
|
|
|
|
Do the sum 94 * 30 in code and store the result
Use: variables[1]
|
|
|
|
Print each number from 1 to 36
Use: loops[2]
|
|
|
|
|