‘int’ object has no attribute called ‘append’

The line score = len([]) uses the len function, which returns the INTEGER (int) length of the list specified. In python, integers cannot be appended to, like you are trying to do when you try to append the score at the end. Perhaps what you were intending to do was add to the score, for which the syntax is score = score + 1 and the shorthand version is score += 1

Leave a Comment