Code Writer
Level 3, 2026-05-09
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
A triangle has sides of 4, 5 and 5. Create variables for the sides of the triangle and then calculate its perimeter.
Use: variables[2]
|
|
|
|
Assume you have 2 lists of numbers that are the same size: F and Z. Count how many times an element in F is equal to the element in the same position in Z.
Use: variables, loops[2]
|
|
|
Test Using: F = [5], Z = [5] F = [1,2,3], Z = [3,2,1] F = [13,16,20], Z = [1,5,35] |
Write a loop that prints "dumdum" 43 times
Use: loops[2]
|
|
|
|
Use a loop to create a string that has 14 "B" characters
Use: variables, loops[2]
|
|
|
|
Print each number from 1 to 30
Use: loops[2]
|
|
|
|
Assume you have a list of letters B. Write code to count the number of times the letter "A" appears in the list.
Use: variables, loops, if[2]
|
|
|
Test Using: B = [] B = ['A','a','z'] B = ['A','A','A'] |
Assume you have a list of numbers Z. Write code to count how many numbers in the list are smaller than 19
Use: variables, loops, if[3]
|
|
|
Test Using: Z = [] Z = [19,0,25] Z = [29,94,34] |
|