Code Writer
Level 3, 2026-03-27
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 add the numbers from 0 to 40
Use: variables, loops[2]
|
|
|
|
Write a loop that prints "moo" 34 times
Use: loops[2]
|
|
|
|
Assume you have a non-empty list of numbers VAR. Write code to find the smallest number in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: VAR = [1,2,3] VAR = [3,2,1,0] VAR = [15,8,18] |
Assume you have a non-empty list Z. Print the first element in the list.
Use: variables[1]
|
|
|
Test Using: Z = [1] Z = ['b','a','c'] Z = [55,82,63] |
Print a variable that contains your first name
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 = [48,73,23] |
A rectangle has sides of 4 and 6. Create variables for the sides of the shape and then calculate its area
Use: variables[2]
|
|
|
|
Use a loop to print 51 lines with a line number and the word "e". For example, line 1 should be "1: e", line 2 would be "2: e", etc.
Use: variables, loops, str()[2]
|
|
|
|
Assume you have 2 lists of numbers with 4 elements each: VAR and Z. Add the 4th elements of the lists together.
Use: variables[1]
|
|
|
Test Using: VAR = [1,2,3,...,4], Z = [1,2,3,...,4] |
|