int()
returns an integer, but you discard that result. Reassign it:
highscore = int(highscore)
The function does not change the variable in-place. If self.score
is a string as well, you'll need to do the same thing for int(self.score)
, or just remove that line.