[Solved] TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’


You’re getting the points out as a string, and need to convert them to an int before doing any computation with it, ideally as soon as possible:

points = int(next_line(the_file))

in next_block should do the trick.
Also, you are not adding the points to the score, you’re replacing it.

total = sum(points + points)
score = total

should be

score += points

to add ‘points’ to ‘score’.

0

solved TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’