title: My program only appends one user input to list when main is looped
body: <p>This is part of my code for a guessing game. I want to count the guesses of a player, and then append their name and number of guesses to a list that is later written or appended to file. As of now, it only appends the last player of the game to the list and file, not all the players. What do I do wrong?</p>
  
  <pre><code>from typing import List, Tuple
  def choose:
  '"code""""""
  
  
  
  
  guesses = 0
  
  while choose(): 
      guesses += 1 
      pass
  
      name = input('What is your name?:')
  
      highscore: List[Tuple[str, int]] = []
      highscore.append((name, guesses))
  
      sorting_by_second = sorted(highscore, key=lambda X: X[1])
  
      with open('highscore.txt', 'w') as f:
          for name, guesses in sorting_by_second:
             f.write(f'{name} guess {guesses}.\n')
  
  
      new_player = input('New player?(yes/no:').lower()
      if new_player == 'yes':
        main()
  
      else:
          break
  
  
  main()
  </code></pre>