I am doing an exercise with python for a course I am currently enrolled in, but I cannot figure out how to add multiple inputs from the same loop together, here is the code I have so far:
ClassesTaken = input ("How many Classes are you taking?")
Class_Amount = int(ClassesTaken)
for i in range (Class_Amount):
print("Class", i+1)
Credits = int(input("How many credits for this class?"))
total = 0
total += Credits
print(total)
I am trying to add the inputs within the for loop
total = 0outside theforloop (above), since you re-assign it to0on every iteration.