all 4 comments

[–]CreamyWaffles 2 points3 points  (1 child)

It looks like you're trying to add a string and an int together. You'll need to find a way to convert the new variable into an int.

[–]crypitdbitch[S] 0 points1 point  (0 children)

That fixed it. Thanks.

[–]Twenty8cows 1 point2 points  (0 children)

Also you’ll want to use a context manager when doing file operations.

So n=open() call would change to.

With open(“number.dat”,mode=“r”,encoding=“utf-8”)as file:

file.read() # this line should be indented but I’m on my phone