title: Python - appending to a pickled list
body: <p>I'm struggling to append a list in a pickled file.
  This is the code:</p>
  
  <pre><code>#saving high scores to a pickled file
  
  import pickle
  
  first_name = input("Please enter your name:")
  score = input("Please enter your score:")
  
  scores = []
  high_scores = first_name, score
  scores.append(high_scores)
  
  file = open("high_scores.dat", "ab")
  pickle.dump(scores, file)
  file.close()
  
  file = open("high_scores.dat", "rb")
  scores = pickle.load(file)
  print(scores)
  file.close()
  </code></pre>
  
  <p>The first time I run the code, it prints the name and score.</p>
  
  <p>The second time I run the code, it prints the 2 names and 2 scores.</p>
  
  <p>The third time I run the code, it prints the first name and score, but it overwrites the second name and score with the third name and score I entered.  I just want it to keep adding the names and scores.  I don't understand why it is saving the first name and overwriting the second one. </p>