Code Writer
Level 3, 2026-10-14
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 38 / 49 in code and store the result
Use: variables[1]
|
|
|
|
Assume you have a list of numbers Q. Print the 9th element of Q.
Use: variables[1]
|
|
|
Test Using: Q = [1,2,3,4,5,6,7,8,9,10] |
Assume you have a list of numbers Z. Write code to count how many numbers in the list are smaller than or equal to than 20
Use: variables, loops, if[3]
|
|
|
Test Using: Z = [] Z = [20,0,25] Z = [66,79,6] |
Assume you have a list Z with at least 2 elements. Create a new variable that is equal to the first two elements added together.
Use: variables[1]
|
|
|
Test Using: Z = ['a','b','c'] Z = ['big','dog'] Z = [33,8,21] |
Print each number from 0 to 20
Use: loops[2]
|
|
|
|
Assume you have a list of numbers F. Write code to count the number of times the number 44 appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: F = [44] F = [0,44,-1,44,99,44] F = [2,74,87] |
Do the sum 93 + 50 and print the result
Use: [1]
|
|
|
|
Assume you have a non-empty list of numbers E. Write code to find the biggest number in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: E = [1,2,3] E = [3,2,1,0] E = [5,90,90] |
Assume you have 2 lists of numbers with 19 elements each: Z and B. Add the 10th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: Z = [1,2,3,...,19], B = [1,2,3,...,19] |
Assume you have a non-empty list Z. Print the first element in the list.
Use: variables[1]
|
|
|
Test Using: Z = [1] Z = ['b','a','c'] Z = [23,28,55] |
|