Code Writer
Level 3, 2026-08-30
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 87 * 98 and print the result
Use: [1]
|
|
|
|
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Assume you have a list of numbers Y. Print the 9th element of Y.
Use: variables[1]
|
|
|
Test Using: Y = [1,2,3,4,5,6,7,8,9,10] |
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 63!
Use: variables, loops, str()[2]
|
|
|
|
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Do the sum 83 - 36 and print the result
Use: [1]
|
|
|
|
Use a loop to add the numbers from 0 to 21
Use: variables, loops[2]
|
|
|
|
Use a loop to print 80 lines with a line number and the word "diddles". For example, line 1 should be "1: diddles", line 2 would be "2: diddles", etc.
Use: variables, loops, str()[2]
|
|
|
|
Use a loop to print 75 lines with the numbers from 1 to 75 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]
|
|
|
|
Use a loop to print the average of the numbers from 0 to 3
Use: variables, loops[2]
|
|
|
|
|