Re: [Pythonmac-SIG] Some test code

2011-02-03 Thread Christopher Barker
On 2/2/11 8:45 PM, Chris Rebert wrote: Also, your question isn't Mac-specific, so for future reference, it would have been better posed to the more general and widely-read python-list (http://mail.python.org/mailman/listinfo/python-list ). or better yet, the python tutor list: http://mail.pyt

Re: [Pythonmac-SIG] Some test code

2011-02-03 Thread Chris Rebert
> On 3 February 2011 07:48, Henning Hraban Ramm wrote: >> Am 2011-02-03 um 05:45 schrieb Chris Rebert: >> if (card == "Hearts" or card == "Diamonds"):    print "That card is Red" elif (card == "Spades" or card == "Clubs"):    print "That card is Black" >>> >>> Note that th

Re: [Pythonmac-SIG] Some test code

2011-02-03 Thread Fandekasp
If you have only 4 type of cards, it's even better to write a oneliner : print card in ["Hearts", "Diamonds"] and "That car is red" or "That card is > Black" On 3 February 2011 07:48, Henning Hraban Ramm wrote: > Am 2011-02-03 um 05:45 schrieb Chris Rebert: > > > if (card == "Hearts" or card

Re: [Pythonmac-SIG] Some test code

2011-02-02 Thread Henning Hraban Ramm
Am 2011-02-03 um 05:45 schrieb Chris Rebert: if (card == "Hearts" or card == "Diamonds"): print "That card is Red" elif (card == "Spades" or card == "Clubs"): print "That card is Black" Note that the parentheses are completely unnecessary and not idiomatic style. if card == "Hea

Re: [Pythonmac-SIG] Some test code

2011-02-02 Thread Chris Rebert
On Wed, Feb 2, 2011 at 7:23 PM, John Parker wrote: > All, > > I have written this test code > > if (card == "Hearts" or card == "Diamonds"): >     print "That card is Red" > > elif (card == "Spades" or card == "Clubs"): >     print "That card is Black" Note that the parentheses are completely unn