Code Writer
Level 3, 2026-02-10
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Assume you have a non-empty list of numbers F. Create a new variable that is equal all the numbers in F multiplied together.
Use: variables, loops[2]
|
|
|
Test Using: F = [1,1] F = [1,2,3,4,5] F = [49,20,82] |
Print a list of strings, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Assume you have a list of numbers Z. Print the 6th element of Z.
Use: variables[1]
|
|
|
Test Using: Z = [1,2,3,4,5,6,7,8,9,10] |
Assume you have a non-empty list of scores VAR for your math class. Calculate the minimum of the scores.
Use: variables, loops[3]
|
|
|
Test Using: VAR = [10] VAR = [1,2,3,4,5] VAR = [51,84,31] |
Write a loop that prints "dumdum" 78 times
Use: loops[2]
|
|
|
|
Use a loop to print 28 lines with a line number and the word "plop". For example, line 1 should be "1: plop", line 2 would be "2: plop", etc.
Use: variables, loops, str()[2]
|
|
|
|
Set two variables to different strings then make a new variable that combines them with a "b" in between
Use: variables[1]
|
|
|
|
Assume you have two non-empty lists of numbers E and Z. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: E = [1], Z = [1] E = [1,2,3], Z = [3,2,1] E = [100,18,47], Z = [62,74,15] |
|