Looks like you are working through a book aimed at Python 2. You need to open your file in binary mode; add b
to the mode:
Hscore = open('highscore.txt', 'ab')
If your book contains more issues like these, it may be time to switch to one that supports Python 3 or to install Python 2.7 at least for the purposes of completing the book exercises.