Code Writer
Level 3, 2026-04-16
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]
|
|
|
|
Set a variable to one value then change that value
Use: variables[1]
|
|
|
|
A right angled triangle has 2 shorter sides of 6 and 1. Calculate the other side (the "hypotenuse").
Use: variables, sqrt()[2]
|
|
|
|
Assume you have a non-empty list of numbers B. Write code to find the biggest number in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: B = [1,2,3] B = [3,2,1,0] B = [99,90,69] |
Use a loop to create a string that has 35 "b" characters
Use: variables, loops[2]
|
|
|
|
Create a list containing 4 numbers
Use: variables[1]
|
|
|
|
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 = [82,2,27] |
Do the sum 68 + 60 in code and store the result
Use: variables[1]
|
|
|
|
Use a loop to print the sum of the numbers from 8 to 20
Use: variables, loops[2]
|
|
|
|
Use a loop to create a string that has 35 "C" characters
Use: variables, loops[2]
|
|
|
|
|