[Tutor] if statement
Joel Goldstick
joel.goldstick at gmail.com
Tue Nov 2 20:42:21 CET 2010
On Tue, Nov 2, 2010 at 3:17 PM, Glen Clark <glenuk at gmail.com> wrote:
> I tried that and it still does not work.
>
> On Tue, 2010-11-02 at 15:13 -0400, James Reynolds wrote:
> > the syntax is:
> >
> >
> > if True:
> > do something that you want to do if the condition you are testing
> > is True, in your case when confirmed is "y"
> > elif True:
> > optional: do something else when the above condition is false and
> > this condition is True.
> > else:
> > do something else when the above conditions are false.
> >
> >
> > You can try this,
> >
> >
> > if confirmed == "y":
> > stuff
> > else:
> > pass
> >
> >
> >
> >
> > On Tue, Nov 2, 2010 at 3:02 PM, Glen Clark <glenuk at gmail.com> wrote:
> > File "/home/glen/workspace/test.py", line 19
> > if confirmed == "y":
> > ^
> > SyntaxError: invalid syntax
> >
> > Why does this not work??? PyDev says "Expected:else"
> >
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > To unsubscribe or change subscription options:
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
>
> change = int(input("Which item would you like to change: ")
In the line about you have mismatched parentheses. This confuses the parser
_______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101102/2eed2bbc/attachment.html>
More information about the Tutor
mailing list