Code Writer
Level 3, 2026-05-09
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 26 + 40 and print the result
Use: [1]
|
|
|
|
Print your first name
Use: [1]
|
|
|
|
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 = [] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
Create a list containing 3 fruit
Use: variables[1]
|
|
|
|
A triangle has sides of 3, 4 and 7. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Do the sum 35 + 34 in code and store the result
Use: variables[1]
|
|
|
|
Use a loop to add the numbers from 0 to 52
Use: variables, loops[2]
|
|
|
|
Assume you have a list of names, Z. Write code to count the number of times the name "Jenny" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: Z = [] Z = ['Jenny'] Z = ['Jenny','Jenny','Julie','Jenny'] |
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] |
Set two variables to different values then add them together
Use: variables[1]
|
|
|
|
|