title: Python How to keep tally of score
body: <p>Trying to make a score based blackjack game. I have it running and everything is working except the score tally. It marks the point after the round but resets to 0 after. here is the section that is giving me issues</p>
  
  <pre><code>pScore = dScore = 0
  
  def play()
      while len(deck) &gt;= 4:
  
          deal(deck, phand, dhand)
  
          moves(deck, phand, dhand, player, dealer)
  
          win(player, dealer, dhand, phand, pScore, dScore)
  
  def win(player, dealer, dhand, phand, pScore, dScore): 
      player = sum(phand)
      dealer = sum(dhand)
  
      if player == 21 and dealer != 21:
          pScore += 1
          print "Player wins!"
      elif player &lt; 21 and player &gt; dealer:
          pScore += 1
          print "Player wins!"
      elif player &lt;= 21 and dealer &gt; 21:
          pScore += 1
          print "Player wins!"
      elif dealer == 21 and player != 21:
          dScore += 1
          print "Dealer wins!"
      elif dealer &lt; 21 and dealer &gt; player:
          dScore += 1
          print "Dealer wins!"
      elif dealer &lt;= 21 and player &gt; 21:
          dScore += 1
          print "Dealer wins!"
      elif player == dealer:
          print "Push!"
  
      print "\nPlayer's Score= ", pScore, "\nDealer's Score= ", dScore, "\n"
  
      return (pScore, dScore) 
  </code></pre>