Why do we need an escape character for single quoted string, but not for a double quoted string?
a = 'hello how's it going'
a1 = 'hello how's it going'
b = "hello how's it going"
assert(a==b) # Passes
assert(a1==b) # Errors
The error message:
File "string.py", line 1
a = 'hello how's it going'
^
SyntaxError: invalid syntax
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…