首页 > 解决方案 > 为什么这行代码有一个反斜杠作为输出?

问题描述

>>> 'She said, "That' + "'" + 's hard to read."'
'She said, "That\'s hard to read."'

为什么这行代码在输出中有反斜杠?

标签: pythonstringescaping

解决方案


推荐阅读