Code Writer
Level 3, 2026-09-06
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Create a list containing 4 colors and then print each one
Use: variables, loops[2]
|
|
|
|
Print each number from 6 to 10
Use: loops[2]
|
|
|
|
Assume you have 2 variables S and T that are equal to the sides of a rectangle. Calculate another variable that is equal to the area of the rectangle.
Use: variables[2]
|
|
|
Test Using: S = 79, T = 42 |
Use a loop to print a list of numbers, including a line number on each line
Use: variables, loops, str()[2]
|
|
|
|
Use a loop to print the average of the numbers from 9 to 22
Use: variables, loops[2]
|
|
|
|
A rectangle has sides of 8 and 4. Create variables for the sides of the shape and then calculate its perimeter
Use: variables[2]
|
|
|
|
Use a loop to print the average of the numbers from 5 to 21
Use: variables, loops[2]
|
|
|
|
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 = [15,28,29] |
|