0
I have encountered a weird typo interpretations using Escape sequence in data entered by user, please help to find out why?
Statement 1: >>>input("Enter Data: ") Enter Data: Hi\n\"Gaurav\" 'Hi\\n\\"Gaurav\\"' Statement 2: >>>c = input("Enter Data: ") Enter Data: Hi \n\"Gaurav\" >>>print(c) Hi\n\"Gaurav\" in Statement 1 when the user also entered escape character It is interpreted as Double backslash,why? in statement 2: It is supposed to be enter new line or double quotes but it doesn't why?
2 Answers
+ 1
Interesting .. sorry idk tho
0
yup python is much weird than c