Hi Alan: Yay! I pressed Enter after the print, and then delete. Which brought the cursor back to the starting position at the beginning of the line, and no more elif syntax errors. This is good to know. Thank you very much.
I also took the liberty of checking out your computing website. It is really helpful; and I have added it to my bookmarks. Thanks a ton! Sudarshana. On Fri, Aug 13, 2010 at 1:27 AM, Alan Gauld <alan.ga...@btinternet.com>wrote: > > "Sudarshana Banerjee" <sudarshan...@gmail.com> wrote > > > Could you take a look at this please: >> >>> x=3 >>>>> if x==0: >>>>> >>>> print "x is 0" >> >> elif x&1==1: >>>>> >>>> SyntaxError: invalid syntax >> >> See, the moment I am pressing Enter the >>> is coming.. not ... >> > > IDLE doesn't give you a ... prompt it gives you spaces. > So you mistake is that ypu are hitting Enter after your print line. It > needs to look like: > > > x=3 >>>> if x==0: >>>> >>> print "x is 0" > elif x&1==1: > print.... > > Which looks horrible and I wish Idle were fixed so it didn't do this. > I keep meaning to try and find a way to patch it myself! > > > Essentially you need to ignore the >>> offset in the if line. > > HTH, > > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor