My code looks like this:
def storescores(): hs = open(\"hst.txt\",\"a\") hs.write(name) hs.close()
so if I run it and enter \"Ry
I had the same issue. And I was able to solve it by using a formatter.
file_name = "abc.txt" new_string = "I am a new string." opened_file = open(file_name, 'a') opened_file.write("%r\n" %new_string) opened_file.close()
I hope this helps.