I have recently started coding and currently I'm doing an exercise where I need to create a program that prints "15, 14, 12, 9, 5". The program should be created with the pieces provided in the code. This means that I can only move these lines of code around but not alter them or add new code. I have reached a point where I can print "5, 9, 12, 14, 15", but I don't know how to reverse this with these "puzzle pieces". Could someone help me out?
EDIT: Got an answer, thanks!
i = 0
MAX = 5
sum = 0
j = MAX
while j > i:
while i < MAX:
sum += j
print(sum)
j -= 1
i += 1