我阅读了官方手册并找到了这些示例。
'"Isn\'t," she said.'
如果我将其更改
\'
为'
'"Isn't," she said.'
python 会告诉你这是无效的语法。
但是,如果我将其更改
'
为"
'"Isn"t," she said.'
它打印没有错误。
我认为里面的
" "
,'
会被视为一个字符,但是为什么 python 告诉我有语法错误?如果我把它改成
'''"Isn't," she said.'''
它打印正常。和有什么区别
'''"Isn't," she said.'''
和
'"Isn't," she said.'
?