Code Writer
Level 3, 2026-11-22
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Use a loop to add the numbers from 0 to 52
Use: variables, loops[2]
|
|
|
|
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Use a loop to print 14 lines with the numbers from 1 to 14 and each number times 14, separated by a commma.
For example, line 1 would be "1, 14", line 2 would be "2, 28",etc.
Use: variables, loops, str()[2]
|
|
|
|
Print a list of strings, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Assume you have a variable S that is the length of the side of a square. Calculate another variable that is equal to the perimeter of the square.
Use: variables[2]
|
|
|
Test Using: S = 80 |
Assume you have a list of numbers VAR. Write code to add up the numbers in the list that are bigger than 4
Use: variables, loops, if[3]
|
|
|
Test Using: VAR = [] VAR = [5,6,7,8,9,10,11,12,13,14,15] VAR = [26,74,38] |
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
Use a loop to add the numbers from 0 to 36
Use: variables, loops[2]
|
|
|
|
|