title: How to debug OOP Class/Method in Python
body: <p>I'm attempting the canonical pedagogical programming exercise of building a program to simulate a card game.  This is how far I am:</p>
  
  <pre><code> class Card:
  
       def __init__(self, suit, rank):
           self.suit = suit
           self.rank = rank
           self.card = str(self.suit) + " " + str(self.rank)
  
   class Deck:
  
       def __init__(self):
           self.deck = []
  
       def Deck_Maker(self):
           ranks = range(1, 11) + ["J", "Q", "K", "A"]
           suits = ["Club", "Heart", "Spade", "Diamond"]
  
           return self.deck.append(Card(suits[0], ranks[0]))
  </code></pre>
  
  <p>Obviously I'm not done, I have to loop over suits and ranks to construct the deck.  However, before continuing I want to check that I'm on track.  To do this I want to print the results after invoking the Deck_Maker method.  I have attempted to do this with the below code...</p>
  
  <pre><code> def __str__(self):
           d = self.deck
           d2 = d.Deck_Maker()
           return str(d2)
  </code></pre>
  
  <p>Unfortunately, <code>print(Deck().Deck_Maker())</code> returns <code>None</code>.</p>
  
  <p>What am I doing wrong?  More generally, how do programmers poke around within Classes and Methods while they make them?</p>
  
  <p>Thanks! </p>