Code Writer
Level 3, 2026-10-28
Answers should be legal Python code, including indentation. Use the underscore _ to show a space.
Special functions: print(), range(), sqrt(), str()
Print your first name

Use: [1]
Print each number from 0 to 16

Use: loops[2]
Use a loop to print 46 lines with a line number and the word "fake". For example, line 1 should be "1: fake", line 2 would be "2: fake", etc.

Use: variables, loops, str()[2]
Print a list of strings, including a line number on each line

Use: variables, loops, str()[2]
A list contains a series of attacks on an enemy. The list looks like [1,2,3,1,1,2,...] where each element in the list is a number that means a type of attack:

1 is a light attack, taking 1HP
2 is a medium attack taking 5HP
3 is a strong attack taking 20HP

Write code to calculate the total amount of HP damage caused by all the attacks.

Use: variables, loops, if[3]

Test Using:
attacks = [1,2,3]
attacks = [1,2,3,3,2,1]
attacks = [42,46,91]
Assume you have 2 lists of numbers that are the same size: Z and A. Count how many times an element in Z is smaller than the element in the same position in A.

Use: variables, loops[2]

Test Using:
Z = [5], A = [5]
Z = [1,2,3], A = [3,2,1]
Z = [55,13,4], A = [53,48,15]
Use a loop to add the numbers from 0 to 38

Use: variables, loops[2]
Assume you have 2 lists of numbers with 12 elements each: Z and X. Add the 8th elements of the lists together.

Use: variables[1]

Test Using:
Z = [1,2,3,...,12], X = [1,2,3,...,12]