Code Writer
Level 3, 2026-07-12
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: VAR and B. Count how many times an element in VAR is smaller than or equal to the element in the same position in B.
Use: variables, loops[2]
|
|
|
Test Using: VAR = [5], B = [5] VAR = [1,2,3], B = [3,2,1] VAR = [20,38,41], B = [38,52,94] |
Assume you have a variable VAR. If VAR is bigger than 2 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: VAR = 0 VAR = 5 VAR = 10 |
Assume you have 2 variables S and T that are equal to the sides of a rectangle. Calculate another variable that is equal to the area of the rectangle.
Use: variables[2]
|
|
|
Test Using: S = 56, T = 93 |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Use a loop to multiply the numbers from 1 to 14
Use: variables, loops[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 = 56 |
Assume you have a variable VAR. If VAR is bigger than 6 print "big", otherwise print "small"
Use: variables, if[2]
|
|
|
Test Using: VAR = 0 VAR = 5 VAR = 10 |
Assume you have a non-empty list E. Create a new variable that is equal to the first element in the list.
Use: variables[1]
|
|
|
Test Using: E = [1] E = ['a','b','c'] E = [43,13,24] |
Do the sum 72 * 29 and print the result
Use: [1]
|
|
|
|
|