text: # Stone Sha, CS 491
  class Dealer:
  
      def __init__(self, deck, player):
          self.hand = []
          self.deck = deck
          self.player = player
          self.hidden = False
  
  
      def deal(self):
          self.hand.append(self.deck.returnCard())
          self.hand.append(self.deck.returnCard())
          self.player.hand.append(self.deck.returnCard())
          self.player.hand.append(self.deck.returnCard())
          self.hidden = True
  
      def afterStand(self):
          self.hidden = False
          if self.getVal() < 17:
              self.hand.append(self.deck.returnCard())
              return False
          else:
              return True
  
      def getVal(self):
          sum = 0
          for card in self.hand:
              sum += card.getVal()
  
          #check for an ace
          if any(card.number == "ace" for card in self.hand) and sum <= 11:
              sum += 10
  
          return sum
  
      def getHand(self):
          handStr = ""
  
          for i, card in enumerate(self.hand):
              if i == 0:
                  handStr += (str(card))
              elif i == 1 and self.hidden == True:
                  handStr += ", face down card"
              else:
                  handStr += (", " + str(card))
          
          return handStr
  
      def bust(self):
          sum = self.getVal()
  
          
          if sum > 21:
              return True
          else:
              return False