title: How to append class object to list
body: <p>After instantiating a deck (<code>deck = Deck()</code>), calling <code>deck.show_deck()</code> just prints out "two of diamonds" 52 times. The 'copy' part is as per <a href="https://stackoverflow.com/questions/2196956/add-an-object-to-a-python-list">this answer</a>, but doesn't seem to help. Any suggestions?</p>
  
  <pre><code>import copy
  from card import Card
  
  class Deck:
  
      card_ranks = ['ace','king','queen','jack','ten','nine','eight','seven','six','five','four','three','two']
      card_suites = ['clubs','hearts','spades','diamonds']
  
      deck = []   
  
      def __init__(self):
          #create a deck of 52 cards
  
          for suite in Deck.card_suites:
              for rank in Deck.card_ranks:
                  Deck.deck.append(copy.deepcopy(Card(card_rank=rank, card_suite=suite)))
  
  
  
      def show_deck(self):
          for item in Deck.deck:
              print item.get_name()
  </code></pre>
  
  <p>Card:</p>
  
  <pre><code>class Card:
  
      card_name = ''
  
      def __init__(self, card_rank, card_suite):
          self.card_rank = card_rank.lower()
          self.card_suite = card_suite.lower()
          Card.card_name = card_rank + " of " + card_suite
  
      def get_name(self):
          return Card.card_name
  </code></pre>