Code Writer
Level 3, 2026-06-16
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Print each number from 2 to 14
Use: loops[2]
|
|
|
|
Assume you have a list variable LIST. Count the number of items in LIST and print the result.
Use: loops, variables[2]
|
|
|
Test Using: LIST = ['a','b','c'] LIST = [1,2,3,4,5,6] LIST = [] |
Assume you have a variable S that is the length of the side of a square. Calculate another variable that is equal to the area of the square.
Use: variables[2]
|
|
|
Test Using: S = 74 |
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 33!
Use: variables, loops, str()[2]
|
|
|
|
Assume you have a non-empty list F. Print the first element in the list.
Use: variables[1]
|
|
|
Test Using: F = [1] F = ['b','a','c'] F = [12,4,80] |
Assume you have a variable Q. If Q is bigger than 2 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: Q = 0 Q = 5 Q = 10 |
Write a loop that prints "dumb" 84 times
Use: loops[2]
|
|
|
|
Use a loop to print the average of the numbers from 8 to 19
Use: variables, loops[2]
|
|
|
|
|