+ 3
It is called escape character, it's a way to insert a special character into a string. For example if you have a string wrapped in single quotes, you can't put a single quote or apostrophes between the wrapping quotes, and you can't put double quoted words inside a string wrapped in double quotes, that's when you use escape character. Try the following statements and try to remove the backslash in each string to see what happens. single_quoted = 'They say it doesn\'t matter' double_quoted = "but I say \"escape character\" matters" print (single_quoted) print (double_quoted) Hth, cmiiw
6th Jan 2018, 3:22 PM
Ipang