title: Printing deck of cards using classes in python 3
body: <p>I am having an issue with only one card printing when I run my file. It is only printing "Two of Spades". I wish to print the whole deck. I have no problems printing when I do not use classes. But right now I am trying to understand classes. Could anyone tell me what i am doing wrong? My code below.....</p>
  
  <pre><code>RANKS = {2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Seven",
           8: "Eight", 9: "Nine", 10: "Ten", 11: "Jack", 12: "Queen",
           13: "King", 14: "Ace"}
  
  SUITS = {1: "Spades", 2: "Clubs", 3: "Diamonds", 4: "Hearts"}
  ################################################
  class Card():
      def __init__(self, rank, suit):
          self.rank = rank
          self.suit = suit
  
      def __str__(self):
          return "%s of %s" %(self.rank, self.suit)
  
  class Deck():
      def __init__(self):
          self.cards = []
          for r in RANKS.values():
              for s in SUITS.values():
                  self.cards.append(Card(r, s))
  
      def __str__(self):
          for i in self.cards:
              return str(i)
  
  deck = Deck()
  print(deck)
  </code></pre>