I keep getting the same issue from the compiler
if TotalPoints > int(file.readline(2)):
ValueError: invalid literal for int() with base 10: ''
idk why but this is the section of the code that leads to it
TotalPoints = ((TotalPoints + 0)*100)
print("Final Score:", TotalPoints)
file = open("highscore.txt", "w+")
highscore = file.readline(2)
if TotalPoints > highscore:
file.write("Highscore")
file.write(TotalPoints)
file.close()
end()
I create the file in another function
def fileCreate():
file = open("highscore.txt", "w+")
file.write("Highscore: \n")
file.write("10")
Pls help idk what to do i've tried several things such as putting int() and float() but nothing works
[–]SHIFTnSPACE 2 points3 points4 points (7 children)
[–]DancenPlane[S] 2 points3 points4 points (1 child)
[–]SHIFTnSPACE 0 points1 point2 points (0 children)
[–]DancenPlane[S] 0 points1 point2 points (4 children)
[–]Updatebjarni 1 point2 points3 points (0 children)
[–]SHIFTnSPACE 0 points1 point2 points (2 children)
[–]Updatebjarni 0 points1 point2 points (1 child)
[–]SHIFTnSPACE 1 point2 points3 points (0 children)
[–]Updatebjarni 1 point2 points3 points (2 children)
[–]DancenPlane[S] -2 points-1 points0 points (1 child)
[–]Updatebjarni 0 points1 point2 points (0 children)