Code Writer
Level 3, 2026-10-25
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 print 77 lines with a line number and the word "dumdum". For example, line 1 should be "1: dumdum", line 2 would be "2: dumdum", etc.
Use: variables, loops, str()[2]
|
|
|
|
Set two variables to different strings then make a new variable that combines them with a "D" in between
Use: variables[1]
|
|
|
|
Use a loop to multiply the numbers from 1 to 37
Use: variables, loops[2]
|
|
|
|
Use a loop to print a list of numbers, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Assume you have a variable Z. If Z is smaller than 4 add 8 to it, otherwise subtract 9 from it
Use: variables, if[2]
|
|
|
Test Using: Z = 0 Z = 4 Z = 10 |
Set two variables to different strings then make a new variable that combines them with a "d" in between
Use: variables[1]
|
|
|
|
Assume you have a list variable LIST of numbers. Use a variable to add the items in the list
Use: variables, loops[2]
|
|
|
Test Using: LIST = [1] LIST = [1,2,3,4,5,6,7,8,9] LIST = [76,99,4] |
Assume you have 2 lists of numbers that are the same size: B and Q. Count how many times an element in B is smaller than or equal to the element in the same position in Q.
Use: variables, loops[2]
|
|
|
Test Using: B = [5], Q = [5] B = [1,2,3], Q = [3,2,1] B = [31,14,36], Q = [25,23,66] |
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
|