Code Writer
Level 3, 2026-04-23
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 1 to 34
Use: loops[2]
|
|
|
|
Write a loop that prints "dumbdumb" 25 times
Use: loops[2]
|
|
|
|
Assume you have a list of names, Y. Write code to count the number of times the name "Melissa" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Y = [] Y = ['Melissa'] Y = ['Melissa','Mike','Felix','Melissa'] |
Assume you have a list of numbers VAR. Print the 10th element of VAR.
Use: variables[1]
|
|
|
Test Using: VAR = [1,2,3,4,5,6,7,8,9,10] |
Use a loop to print the sum of the numbers from 3 to 20
Use: variables, loops[2]
|
|
|
|
A rectangle has sides of 3 and 6. Create variables for the sides of the shape and then calculate its perimeter
Use: variables[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 list of names, Z. Write code to count the number of times the name "Mongo" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Z = [] Z = ['Mongo'] Z = ['Mongo','Max','Missy','Mongo'] |
|