Wrong with this script?

R.Meijer misthunter at gmail.com
Sat Mar 5 15:53:10 EST 2005


Daniel Fackrell <unlearned <at> gmail.com> writes:

> 
> You need to close the () for input here.  After doing that, if you run it
> you will notice that you get an exception for most inputs, including "yes".
> IIRC, input() is scheduled for removal in some future version of Python
> because it doesn't do what you would expect and it is generally a bad idea
> to use it.  The functionality is along the lines of:
> 
> eval(raw_input('your string here'))
> 
> You undoubtedly want raw_input() instead here.
> 
> >           if again!="yes":
> >           mainloop = 0
> 
> This last line needs indented.
> 
> And a couple of minor points:
> 
> 1. Choose an amount of indentation per level and stick to it.  4 is rather
> common in Python code.
> 
> 2. When posting to the list, make sure that the lines in your code are short
> enough that they will not wrap and be posted as broken code.  70 chars is
> usually safe.
> 
> Daniel Fackrell
> 

Thank you very much for the help and the tips :-) This is my very first python
script, and I knew it would have some stupid mistakes; but it's doing something
weird right now...I did all the stuff you told, me, and now it'll at least run.
But whenI enter a number as a limit, the loop keeps going on forever, nad the
numbers won't stop rolling. I'm guessing this is because it sees limit as a
string, how can I let it see it as an integer?





More information about the Python-list mailing list