Code Writer
Level 3, 2026-05-21
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Write a loop that prints "fake" 74 times
Use: loops[2]
|
|
|
|
Print a variable that contains your first name
Use: variables[1]
|
|
|
|
Create a list containing 4 numbers and then print each one
Use: variables, loops[2]
|
|
|
|
A right angled triangle has a hypotenuse (longest side, opposite the right angle) of 10 and another side of 4. Calculate the length of the missing side.
Use: variables, sqrt()[2]
|
|
|
|
Use a loop to print 88 lines with the numbers from 1 to 88 and each number times 18, separated by a commma.
For example, line 1 would be "1, 18", line 2 would be "2, 36",etc.
Use: variables, loops, str()[2]
|
|
|
|
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Create a list containing 2 animals and then print each one
Use: variables, loops[2]
|
|
|
|
Assume you have two non-empty lists of numbers Q and X. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: Q = [1], X = [1] Q = [1,2,3], X = [3,2,1] Q = [31,65,10], X = [46,18,34] |
Assume you have a list X with at least 2 elements. Create a new variable that is equal to the first two elements added together.
Use: variables[1]
|
|
|
Test Using: X = ['a','b','c'] X = ['big','dog'] X = [86,39,12] |
Print your first name
Use: [1]
|
|
|
|
|