Code Writer
Level 2, 2025-07-06
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Assume you have a list variable LIST. Count the number of items in LIST.
Use: loops, variables[2]
|
|
Test Using: LIST = ['a','b','c'] LIST = [1,2,3,4,5,6] LIST = [] |
Print each number from 0 to 19
Use: loops[2]
|
|
|
Print your first name
Use: [1]
|
|
|
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 perimeter of the rectangle.
Use: variables[2]
|
|
Test Using: S = 59, T = 83 |
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 = [] |
Do the sum 73 * 22 in code and store the result
Use: variables[1]
|
|
|
Assume you have a list variable LIST. Print each value in LIST.
Use: loops[2]
|
|
Test Using: LIST = [1,2,3] LIST = ['a','b',0] LIST = [] |
Assume you have a non-empty list A. Print the first element in the list.
Use: variables[1]
|
|
Test Using: A = [1] A = ['b','a','c'] A = [41,0,60] |
Set a variable to one value then change that value
Use: variables[1]
|
|
|
Create a list containing 2 fruit
Use: variables[1]
|
|
|
|