1
u/AlexMTBDude 5d ago
progress_list = [] # This is a Python list
progress_set = {} # This is a Python set1
u/Educational-Paper-75 2d ago
progress_set has 10 elements with index 0 through 9, thus there is no element 10, so operation needs to be below 10. You can use integer division // and get rid of mapping to int instead of using real division / on the last line. You probably also want operation to be positive.

2
u/Money_Ad_5277 5d ago edited 5d ago
Does it calculate progression correctly? (Tested, by sheer luck it does, but you should fix it)
Why don't you use
if operation < len(progress_set)?Python has 0-based index arrays, what it means is
range(0, 10) transformed to a list and first element (0th index) is 0 (can be done in one line
progression = [i * 5 for i in range(0, 10)])Let's say your input is "3", your array is [0, 5, 10, 15, 20, 25, 30, 35, 40, 45] you calculate (5 + 15) * 3 / 2 = 30. It is only works out if first element is 0. Because "3" is actually 4th element of the array, which is 15.
Well... it's actually pretty hard to explain... change
range(0, 10)torange(1, 10)and check arithmetic progression sumEdit: sheAr luck...