file = open("c:\\ss.txt", "a")
file = open(r"c:\ss.txt", "a")
Reason —
file = open("c:\\ss.txt", "a")— The syntax to open a filec:\ss.txtisf = open("c:\\temp\\data.txt", "a"). Hence according to this syntaxfile = open("c:\\ss.txt", "a")is correct format.file = open(r"c:\ss.txt", "a")— The syntax to open a filec:\ss.txtwith single slash isf = open(r"c:\temp\data.txt","a").The prefix r in front of a string makes it raw string that means there is no special meaning attached to any character. Hence according to this syntaxfile = open(r"c:\ss.txt", "a")is correct format.