from random import shuffle

# Start a definition of the class Deck
# Represents a deck of card
class Deck:

        # called to create the Deck
        def __init__(self):
                self.cards = [] # start with empty list
                for num in range(1,14): # produces numbers 1-13
                        for suit in ["h","s","c","d"]:  # iterate through list
                                # a card has a number and a suit
                                card = str(num)+suit # it's a string
                                self.cards.append(card) # add to list

        # a method!
        def shuffleDeck(self):  
                shuffle(self.cards)  # this came from the random module

        # pretty printing
        def __str__(self):
                s = ""
                # iterate through the list of cards
                for card in self.cards:  # notice self.cards is visible here
                        s = s+" "+card
                return s
                


def main():
        d1 = Deck()  # calls __init__
        d1.shuffleDeck()  # calls the shuffleDeck method
        print "deck 1",d1  # calls __str__
        print ""

        d2 = Deck()
        d2.shuffleDeck()
        print "deck 2",d2

main()



                                
