Re: [Tutor] Not workin!

2009-10-01 Thread Kent Johnson
On Wed, Sep 30, 2009 at 1:32 AM, Luke Paireepinart wrote: > Oops, thanks for catching that one Marty. I thought they both > evaluated to false. They both evaluate to false in a boolean context but that is different from being *equal* to false or to each other. In [1]: s = '' In [2]: bool(s) Out

Re: [Tutor] Not workin!

2009-09-30 Thread Emile van Sebille
On 9/29/2009 10:32 PM Luke Paireepinart said... Oops, thanks for catching that one Marty. I thought they both evaluated to false. They do when passed to bool -- >>> bool("") == bool([]) True >>> ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] Not workin!

2009-09-30 Thread Brett Wilkins
On 30/09/2009, at 10:44 AM, Luke Paireepinart wrote: On Tue, Sep 29, 2009 at 11:40 PM, Corey Richardson wrote: I got suggested to use this format for my code, as it was shorter and prettier. But It dun work! if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", "Ep

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
Oops, thanks for catching that one Marty. I thought they both evaluated to false. On 9/29/09, Martin Walsh wrote: > Luke Paireepinart wrote: >> In this case you are saying "is their input equal to this list with many >> elements?" and the answer is always going to be No because a string >> won't

Re: [Tutor] Not workin!

2009-09-29 Thread Martin Walsh
Luke Paireepinart wrote: > In this case you are saying "is their input equal to this list with many > elements?" and the answer is always going to be No because a string > won't be equal to a list unless both are empty. I know you probably didn't mean this as it reads, or as I'm reading it, but an

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
> if wellness.strip().lower() in ["well", "fine", "good", "whatever"]: > note if you strip & lowercase the list it is far more likely you'll match > your input. > > And by "lowercase the list" I meant "lowercase the string" of course :) ___ Tutor maillist

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
On Tue, Sep 29, 2009 at 11:40 PM, Corey Richardson wrote: > I got suggested to use this format for my code, as it was shorter and > prettier. But It dun work! > if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", > "Epic"]: > print "Oh, I'm sorry you are not feeling well

Re: [Tutor] Not workin!

2009-09-29 Thread Rich Lovely
2009/9/29 Corey Richardson : > I got suggested to use this format for my code, as it was shorter and > prettier. But It dun work! > if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", > "Epic"]: >   print "Oh, I'm sorry you are not feeling well." >   areYouOk = raw_input("I

[Tutor] Not workin!

2009-09-29 Thread Corey Richardson
I got suggested to use this format for my code, as it was shorter and prettier. But It dun work! if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", "Epic"]: print "Oh, I'm sorry you are not feeling well." areYouOk = raw_input("I guessed correct, right?") if areY