# deck.py
#
# Created by Thomas Nelson on 2014-04-12, tn90ca@gmail.com
#
# This class was developed for public use as part of the 
# Cards package.

from card import Card

 # The Deck class is used to represent a deck of playing
 # cards each card has a suit and a rank. The deck is 
 # capable of being shuffled and dealing one card at a
 # time.
class Deck:
  self.deck = []     # Actual deck representation
  self.cardsUsed = 0 # Keeps track of the cards dealt
  
  self.suits = ['C','H','D','S']
  self.ranks = ['2','3','4','5','6','7','8','9','0','J','Q','K','A']
  
   # Class initializer method creates a new unshuffled deck
   # of cards with all suits and ranks. This deck does not
   # include jokers.
   #
   # @param self  This is a default python class argument
  def __init__(self):
    for suit in self.suits:
      for rank in self.ranks:
        self.deck.append(card(suit,rank))
  # end def __init__
  
   # Method puts all cards back in the deck and then
   # shuffles the deck.
   #
   # @param self  This is a default python class argument
  def shuffle(self):
    self.deck.shuffle()
    self.cardsUsed = 0
  #end def shuffle

   # Method returns the number of cards left in the deck
   # that can be dealt.
   #
   # @param  self       This is a default python class argument
   # @return cardsLeft  This is the number of cards left in the deck
  def cardsLeft(self):
    return len(self.deck - self.cardsUsed)
  # end def cardsLeft
    
   # Method deals one card from the deck and marks it in the list
   # of cards dealt. Returns an error if no cards are left in the
   # deck.
   #
   # @param  self     This is a default python class argument
   # @error  noCards  Throws/prints a no cards left error
   # @return card     Returns/deals a card 
  def dealCard(self):
    if self.cardsUsed == len(self.deck):
      print "Error: There are no cards left in the deck."
    else:
      self.cardsUsed += 1
      return self.deck[self.cardsUsed - 1]
  # end def dealCard
  
   # When print is called on a deck this method will return
   # the list of cards in the deck as a string representation
   # of each cards suit and rank.
   #
   # @param  self  This is is a default python class argument
   # @return deck  This returns the entire deck to be printed 
  def __str__(self):
    return self.deck
  # end def __str__
    
# end class Deck

@@ -357,217 +357,8 @@
 ck:%0A
-  self.deck = %5B%5D     # Actual deck representation%0A  self.cardsUsed = 0 # Keeps track of the cards dealt%0A  %0A  self.suits = %5B'C','H','D','S'%5D%0A  self.ranks = %5B'2','3','4','5','6','7','8','9','0','J','Q','K','A'%5D%0A
   %0A 
@@ -577,24 +577,244 @@
 it__(self):%0A
+    self.deck = %5B%5D     # Actual deck representation%0A    self.cardsUsed = 0 # Keeps track of the cards dealt%0A  %0A    self.suits = %5B'C','H','D','S'%5D%0A    self.ranks = %5B'2','3','4','5','6','7','8','9','0','J','Q','K','A'%5D%0A  %0A
     for suit
@@ -2312,29 +2312,104 @@
 f):%0A    
-return self.d
+tmpDeck = %22Deck: %22%0A    for c in self.deck:%0A      tmpDeck += str(c) + %22 %22%0A    return tmpD
 eck%0A  # 

Update deck.py (__str__ method fix)