Ok. This IS homework ...

Brett Hoerner bretthoerner at gmail.com
Sat Oct 14 19:15:58 EDT 2006


spawn wrote:
> while running:
> 	guess = int(raw_input('Enter an integer that I can use to add : '))
> 	subtotal = guess
> 	while running:
> 		guess = int(raw_input('I\'ll need another number : '))
> 		running_total = guess +	subtotal

You keep adding the original input (subtotal) to the most recent guess,
and printing "running_total".  You never re-assign subtotal or make use
of running_total in your deepest loop.

Also, you never break out of your deepest loop, why are you using two
nested infinite-loops anyway?

Regards,
Brett Hoerner




More information about the Python-list mailing list