"WM" <[EMAIL PROTECTED]> wrote

to IF. The code below was not written by me. It is a copy/paste job from the tutor. I do not have any idea what is going wrong.

>>> x = int(raw_input("Please enter an integer: "))
Please enter an integer: 42
>>> if x < 0:
...      x = 0
...      print 'Negative changed to zero'
... elif x == 0:
...      print 'Zero'
... elif x == 1:
...      print 'Single'
... else:
...      print 'More'
...
More
12
SyntaxError: invalid syntax

It looks as if you maybe cut more than you intended?
Also I'm not sure about the ... prompts. I don't have 2.6 yet
so maybe its an enhancement to IDLE but notmally IDLE
doesn't print ... prompts. Did you cut n paste them too?
If so that would confuse IDLE.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to