[Tutor] Help - accumulator not working (Lea)

Japhy Bartlett japhy at pearachute.com
Sat Apr 16 01:50:59 CEST 2011


I think that here:

>         expense = float(raw_input('Enter the next expense or 0 to finish $'))

you want to use `expense +=` instead.  Instead of adding it to the
previous expenses, you're resetting the `expense` variable each time.

I think there's some other things that won't behave as expected, but
that seems what like you asked.


- @japherwocky


More information about the Tutor mailing list