Code Writer
Level 3, 2026-08-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 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 variable LIST. Count the number of items in LIST.
Use: loops, variables[2]
|
|
|
Test Using: LIST = ['a','b','c'] LIST = [1,2,3,4,5,6] LIST = [] |
Assume you have a list of numbers X. Create a new variable that is equal to sum of all the numbers in X.
Use: variables, loops[2]
|
|
|
Test Using: X = [] X = [1,1] X = [0,61,100] |
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Use a loop to print 62 lines with a line number and the word "bloop". For example, line 1 should be "1: bloop", line 2 would be "2: bloop", etc.
Use: variables, loops, str()[2]
|
|
|
|
Print each number from 1 to 16
Use: loops[2]
|
|
|
|
Assume you have a non-empty list of scores F for your math class. Calculate the mean of the scores.
Use: variables, loops[3]
|
|
|
Test Using: F = [10] F = [1,2,3,4,5] F = [11,73,70] |
|