Code Writer
Level 3, 2026-11-19
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have a variable Z. If Z is bigger than 5 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: Z = 0 Z = 5 Z = 10 |
Print each number from 1 to 18
Use: loops[2]
|
|
|
|
Print each number from 1 to 48
Use: loops[2]
|
|
|
|
Do the sum 97 + 73 and print the result
Use: [1]
|
|
|
|
Assume you have a non-empty list of scores B for your math class. Calculate the maximum of the scores.
Use: variables, loops[3]
|
|
|
Test Using: B = [10] B = [1,2,3,4,5] B = [51,6,20] |
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 = [] |
Create a list containing 3 fruit and then print each one
Use: variables, loops[2]
|
|
|
|
Create a list containing 4 numbers
Use: variables[1]
|
|
|
|
|