Code Writer
Level 3, 2026-08-17
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
A rectangle has sides of 9 and 4. Create variables for the sides of the shape and then calculate its area
Use: variables[2]
|
|
|
|
Use a loop to create a string that has 26 "g" characters
Use: variables, loops[2]
|
|
|
|
Assume you have two non-empty lists of numbers Z and F. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: Z = [1], F = [1] Z = [1,2,3], F = [3,2,1] Z = [92,42,59], F = [32,97,69] |
Assume you have a non-empty list Y. Print the first element in the list.
Use: variables[1]
|
|
|
Test Using: Y = [1] Y = ['b','a','c'] Y = [47,87,48] |
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Use a loop to multiply the numbers from 9 to 20
Use: variables, loops[2]
|
|
|
|
Assume you have a variable S that is the length of the side of a square. Calculate another variable that is equal to the area of the square.
Use: variables[2]
|
|
|
Test Using: S = 39 |
Use a loop to create a string that has 40 "A" characters
Use: variables, loops[2]
|
|
|
|
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 15 and another side of 6. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
|