Code Writer
Level 3, 2026-06-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 2 lists of numbers with 19 elements each: F and VAR. Add the 10th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: F = [1,2,3,...,19], VAR = [1,2,3,...,19] |
Assume you have a list of numbers Z. Write code to add up the numbers in the list that are smaller than or equal to than 12
Use: variables, loops, if[3]
|
|
|
Test Using: Z = [] Z = [5,6,7,8,9,10,11,12,13,14,15] Z = [22,68,40] |
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Assume you have a list of numbers B. Write code to add up the numbers in the list that are smaller than or equal to than 11
Use: variables, loops, if[3]
|
|
|
Test Using: B = [] B = [5,6,7,8,9,10,11,12,13,14,15] B = [22,68,40] |
Use a loop to add the numbers from 0 to 20
Use: variables, loops[2]
|
|
|
|
Create a list containing 4 animals and then print each one
Use: variables, loops[2]
|
|
|
|
Assume you have 2 lists of numbers that are the same size: E and Z. Count how many times an element in E is smaller than or equal to the element in the same position in Z.
Use: variables, loops[2]
|
|
|
Test Using: E = [5], Z = [5] E = [1,2,3], Z = [3,2,1] E = [71,72,82], Z = [60,28,73] |
Create a list containing 4 numbers
Use: variables[1]
|
|
|
|
|