title: Python Blackjack: Updating number of wins after each game
body: <p>This is the function in my blackjack python program for determining the winner of a round. The counts playerScore and dealerScore are supposed to increment with each win, but when running the game multiple times they never increase past 1. I think I need another loop or function to deal with this, but how can I properly increment the wins with multiple plays?</p>
  
  <pre><code>def total(self, dealer):
      # determines winner
      playerScore=0
      dealerScore=0
      if self.hand_sum &gt; dealer.hand_sum:
          print("\nYou won the hand!")
          playerScore+=1
      elif self.hand_sum &lt; dealer.hand_sum:
          if dealer.hand_sum &lt;= 21:
              print("\nYou lost the hand!")
              dealerScore+=1
          else:
              print("\nDealer busted\n")
      else:
          print("\nYou tied\n")
  
      print("Dealer's hand:", dealer.cards, "   Dealer's sum:",      dealer.hand_sum)
      print("Your hand:", self.cards, "Your sum:", self.hand_sum)
      print("\n*******************\n")
      print("Number of Wins:\n")
      print("Player: %d")%playerScore
      print("Dealer: %d")%dealerScore
      print("\n*******************\n")
      start()
  </code></pre>