On Thu, Sep 10, 2009 at 9:54 AM, shellc...@juno.com <shellc...@juno.com> wrote:
> I want to display all the cards in a deck of playing cards using two tuples 
> for all the possible suits.
>
>
>
> value = ("A","2","3","4","5","6","7","8","9","10","J","Q","K")
>
> suit = ("c","h","s","d")
>
> deck = value[0:1] + suit[0:1]
> for item in deck:
>    print item

See itertools.product(), you can use it directly or use a nested list
comprehension as shown in the docs:
http://docs.python.org/library/itertools.html#itertools.product

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to