Code Writer
Level 3, 2026-06-19
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Do the sum 47 * 76 in code and store the result
Use: variables[1]
|
|
|
|
Assume you have a non-empty list VAR. Create a new variable that is equal to the first element in the list.
Use: variables[1]
|
|
|
Test Using: VAR = [1] VAR = ['a','b','c'] VAR = [3,5,95] |
A right angled triangle has 2 shorter sides of 2 and 5. Calculate the other side (the "hypotenuse").
Use: variables, sqrt()[2]
|
|
|
|
Assume you have a variable A. If A is smaller than 2 add 9 to it, otherwise subtract 6 from it
Use: variables, if[2]
|
|
|
Test Using: A = 0 A = 2 A = 10 |
Print a list of strings, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Assume you have two non-empty lists of numbers A and Y. Create a new variable that is equal to the first element of each list added together.
Use: variables[1]
|
|
|
Test Using: A = [1], Y = [1] A = [1,2,3], Y = [3,2,1] A = [62,10,7], Y = [69,70,71] |
Use a loop to create a string that has 36 "c" characters
Use: variables, loops[2]
|
|
|
|
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 = [] |
Create two strings and join them together with a space between
Use: variables[1]
|
|
|
|
Create a list containing 2 fruit
Use: variables[1]
|
|
|
|
|