do you guys help newbies??

James T. Dennis jadestar at idiom.com
Wed Nov 27 15:04:55 EST 2002


John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote:
>>>>>> "malik" == malik m <malik_martin at hotmail.com> writes:

>    malik> hi yea i messed up here's the code sorry about the html too
>    malik> i was using it through hotmail while i learnd and still am
>    malik> learning how to use newsgroups....

> One more thing to watch out for.  When you posted your code, the lines
> were automatically wrapped, making your code unrunnable without
> editing.

> Now, onto the problem!

> You need to convert the raw input to a numeric type, as in 

>  md = int(raw_input("Miles driven: "))

> raw_input comes back as a string.

> John Hunter

 He was calling int() on his results.  (It was completely lacking
 in exception handling, but that's a different issue).

 I think the problem was in his while expression, though he didn't 
 bother to provide a traceback or description of the failure mode so
 we can only guess.





More information about the Python-list mailing list