Re: if then elif

2007-10-11 Thread Michael L Torrie
Michael L Torrie wrote: > Which is exactly what he said. Haha. Nevermind. You're right. A subtle distinction, isn't it. >He also said that what the poster > probably wanted was > > if cal <= 0 or fat <=0 > > -- http://mail.python.org/mailman/listinfo/python-list

Re: if then elif

2007-10-10 Thread Steven D'Aprano
On Wed, 10 Oct 2007 20:42:26 -0600, Michael L Torrie wrote: > [EMAIL PROTECTED] wrote: > > >> that's the most incorrect thing i've heard all day! >> >> if cal or fat <= 0 is parsed as if (cal) or (fat <= 0) > > Which is exactly what he said. Heh, that was my first thought too, for about 3.2 m

Re: if then elif

2007-10-10 Thread Michael L Torrie
[EMAIL PROTECTED] wrote: > > that's the most incorrect thing i've heard all day! > > if cal or fat <= 0 is parsed as if (cal) or (fat <= 0) Which is exactly what he said. He also said that what the poster probably wanted was if cal <= 0 or fat <=0 > -- http://mail.python.org/mailman/listi

Re: if then elif

2007-10-10 Thread thebjorn
On Oct 10, 11:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: [...] > > Boolean problem: > > if cal or fat <= 0 > > That may be the way you say it or "think" it but it won't work. > > 'cal or fat' is evaluated first. Since they both have values this ALWAYS > evaluates to 1 which is NEVER less than o

Re: if then elif

2007-10-10 Thread chris . monsanto
On Oct 10, 5:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Shawn Minisall wrote: > > I just learned about if, then elif statements and wrote this program. > > The problem is, it's displaying all of the possibilities even after you > > enter a 0, or if the fat gram

Re: if then elif

2007-10-10 Thread Larry Bates
Shawn Minisall wrote: > I just learned about if, then elif statements and wrote this program. > The problem is, it's displaying all of the possibilities even after you > enter a 0, or if the fat grams are more then the total number of > calories , that is supposed to stop th

Re: if then elif

2007-10-10 Thread brad
Shawn Minisall wrote: > I just learned about if, then elif statements and wrote this program. > The problem is, it's displaying all of the possibilities even after you > enter a 0, or if the fat grams are more then the total number of > calories , that is supposed to stop th

if then elif

2007-10-10 Thread Shawn Minisall
I just learned about if, then elif statements and wrote this program. The problem is, it's displaying all of the possibilities even after you enter a 0, or if the fat grams are more then the total number of calories , that is supposed to stop the program instead of continuing on wit