title: Total guess count not updating
body: <p>I am a beginner to coding, I am learning python and decided to make a random number guessing game. Everything went great but I want to add a guess counter and I'm not sure why the total wont update.</p>
  
  <pre><code>def random_num():
      guess = int(input("Guess the number, it is between 1-100: "))
      total = 0
      if guess &gt; random_number:
          print("\nLower")
          total += 1
          random_num()
      elif guess &lt; random_number:
          print("\nHigher")
          total += 1
          random_num()
      elif guess == random_number:
          print("\nYou win")
          print("You took " + str(total) + " guesses to get the correct number.")
  </code></pre>
  
  <p>The output is 0 for total but that is incorrect.</p>