I'm trying to make a simple adding function here. I start a count at 0. I want to add the argument of add_credits(x) to the credit total, to keep a running total. A for loop doesn't seem like the right thing to use here, since I don't know how many times I'll be looping.
So what I want to do here is, add 3. Credits = 3. Add 4, credits = 7.
credits = 0
def add_credits(x):
new_total = credits + x
return new_total
print (add_credits(3))
print (add_credits(4))
I know the solution must be really simple... I feel like an idiot.
credits.