Code Writer
Level 3, 2026-04-19
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have two non-empty lists of numbers X and B. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: X = [1], B = [1] X = [1,2,3], B = [3,2,1] X = [12,80,74], B = [85,13,78] |
Assume you have a list of numbers B. Create a new variable that is equal to sum of all the numbers in B.
Use: variables, loops[2]
|
|
|
Test Using: B = [] B = [1,1] B = [8,21,77] |
Print each number from 1 to 46
Use: loops[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 = [] |
Use a loop to add the numbers from 0 to 26
Use: variables, loops[2]
|
|
|
|
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 = [8,21,77] |
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 = [] |
Do the sum 48 - 97 in code and store the result
Use: variables[1]
|
|
|
|
Print your first name
Use: [1]
|
|
|
|
|