Code Writer
Level 3, 2026-08-14
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 list of letters Q. Write code to count the number of times the letter "g" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Q = [] Q = ['g','a','z'] Q = ['g','g','g'] |
Use a loop to multiply the numbers from 1 to 19
Use: variables, loops[2]
|
|
|
|
Assume you have a list variable LIST. Print each value in LIST.
Use: loops[2]
|
|
|
Test Using: LIST = [1,2,3] LIST = ['a','b',0] LIST = [] |
Assume you have a non-empty list of scores B for your math class. Calculate the mean of the scores.
Use: variables, loops[3]
|
|
|
Test Using: B = [10] B = [1,2,3,4,5] B = [45,92,39] |
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 = [45,16,84] |
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
Use a loop to print the average of the numbers from 0 to 9
Use: variables, loops[2]
|
|
|
|
Print your first name
Use: [1]
|
|
|
|
|