I have a for loop that takes an input variable (+1) as the end of its range, and inside it, an if statement that returns factors of said variable:
for i in range(1, int(f)+1):
if f % i == 0:
print(i) #temporary
How would I go about adding together the first/last items on the list, then the 2nd/2nd to last items, and so on? I can’t do this manually because the input variable isn’t the same every time.