Code Writer
Level 3, 2026-07-05
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 51 * 90 and print the result
Use: [1]
|
|
|
|
Use a loop to print 86 lines with the numbers from 1 to 86 and each number times 15, separated by a commma.
For example, line 1 would be "1, 15", line 2 would be "2, 30",etc.
Use: variables, loops, str()[2]
|
|
|
|
Assume you have a variable B. If B is bigger than 8 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: B = 0 B = 5 B = 10 |
Do the sum 40 / 72 in code and store the result
Use: variables[1]
|
|
|
|
Use a loop to add the numbers from 4 to 15
Use: variables, loops[2]
|
|
|
|
Assume you have 2 lists of numbers that are the same size: VAR and Q. Count how many times an element in VAR is bigger than the element in the same position in Q.
Use: variables, loops[2]
|
|
|
Test Using: VAR = [5], Q = [5] VAR = [1,2,3], Q = [3,2,1] VAR = [77,15,55], Q = [99,53,42] |
Assume you have 2 lists of numbers with 13 elements each: VAR and B. Add the 7th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: VAR = [1,2,3,...,13], B = [1,2,3,...,13] |
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Use a loop to print the average of the numbers from 0 to 8
Use: variables, loops[2]
|
|
|
|
Assume you have a non-empty list B. Print the first element in the list.
Use: variables[1]
|
|
|
Test Using: B = [1] B = ['b','a','c'] B = [28,51,21] |
|