Code Writer
Level 3, 2026-02-11
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 75 / 64 and print the result
Use: [1]
|
|
|
|
Assume you have a non-empty list of numbers Y. Write code to find the smallest number in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Y = [1,2,3] Y = [3,2,1,0] Y = [64,25,72] |
Do the sum 36 / 94 and print the result
Use: [1]
|
|
|
|
Set a variable to one value then change that value
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 13
Use: variables, loops, if[3]
|
|
|
Test Using: B = [] B = [5,6,7,8,9,10,11,12,13,14,15] B = [28,79,65] |
Use a loop to print the average of the numbers from 8 to 22
Use: variables, loops[2]
|
|
|
|
Use a loop to print 78 lines with a line number and the word "e". For example, line 1 should be "1: e", line 2 would be "2: e", etc.
Use: variables, loops, str()[2]
|
|
|
|
Use a loop to print 60 lines with a line number and the word "bloop". For example, line 1 should be "1: bloop", line 2 would be "2: bloop", etc.
Use: variables, loops, str()[2]
|
|
|
|
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
|