Running python on unix
kpatrick1979
patrickj at muohio.edu
Fri Mar 28 16:45:03 EST 2003
Hi,
I am a brand new user learning python for a programming languages
class. I am trying to use the practice tutorial to mimic the
following if-statement exercise:
>>> x = int(raw_input("Please enter an integer: "))
>>> if x < 0:
... x = 0
... print 'Negative changed to zero'
... elif x == 0:
... print 'Zero'
... elif x == 1:
... print 'Single'
... else:
... print 'More'
...
However, after I enter the first line of code (i'm using the Python
command line programming that you can get from the web) I immediately
get the "Please enter an integer" line -- it doesn't permit me to type
the rest of the code. Does anyone know a better way for me to try and
do this program? I tried using Unix, but am not having much success
there either (maybe i'm doing that wrong too) Help!
Thanks,
K
More information about the Python-list
mailing list