Code Writer
Level 3, 2026-09-15
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Set two variables to different strings then make a new variable that combines them with a "a" in between
Use: variables[1]
|
|
|
|
Use a loop to create a string that has 18 "a" characters
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 = [18,24,99] |
Print each number from 0 to 36
Use: loops[2]
|
|
|
|
Assume you have a list of names, Z. Write code to count the number of times the name "Missy" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Z = [] Z = ['Missy'] Z = ['Missy','Flip','Melissa','Missy'] |
A factorial of a number is all the numbers from 1 to that number multiplied together, so 4! = 1x2x3x4. Write code using a loop to calculate 56!
Use: variables, loops, str()[2]
|
|
|
|
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
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 = [83,98,93] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
|