Code Writer
Level 3, 2026-02-28
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have 2 lists of numbers that are the same size: E and Q. Count how many times an element in E is bigger than the element in the same position in Q.
Use: variables, loops[2]
|
|
|
Test Using: E = [5], Q = [5] E = [1,2,3], Q = [3,2,1] E = [6,51,35], Q = [55,44,16] |
Use a loop to print the sum of the numbers from 0 to 3
Use: variables, loops[2]
|
|
|
|
Use a loop to multiply the numbers from 1 to 45
Use: variables, 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 = [] |
Write a loop that prints "dumb" 23 times
Use: loops[2]
|
|
|
|
Assume you have a list of names, X. Write code to count the number of times the name "Mike" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: X = [] X = ['Mike'] X = ['Mike','Max','Mike','Mike'] |
Assume you have a list of numbers A. Write code to count how many numbers in the list are bigger than 9
Use: variables, loops, if[3]
|
|
|
Test Using: A = [] A = [9,0,25] A = [88,10,86] |
|