【发布时间】:2022-01-13 15:51:48
【问题描述】:
要清楚,我不想自己打印双引号,我希望 python 用双引号而不是单引号打印出我的字符串?
例如,如果我在 python 中运行以下代码-
print(["this is a string!", "this is another string!"])
结果是
['this is a string!', 'this is another string!']
我希望输出也用双引号引起来。我该怎么做?
【问题讨论】:
-
为什么重要?这两种表示是等价的。
-
你想要什么输出类型?你想让字符串包含双引号还是只当显示方式?