News for hackers. Stuff that matters.
Re:First Impressions of Python from a Java Developer by RyanMcGreal on Monday November 15, 2010 @09:00AM (#1906230)
This blew my mind when I first came across it:

    deck = ['%s%s' % (n, s) for s in 'HDCS' for n in '23456789XJQKA']
It creates a deck of cards.

Also, you can easily shuffle the deck using the standard library.

    import random
    random.shuffle(deck)

There are no comments on this comment yet.