python程序格式化字符%r输出问题?
0
python中字符格式%r输出的字符串会出现双引号吗?
代码:
formatter = "%r %r %r %r"
print formatter % ("I had this thing.",
"That you could type up right.",
"But it didn't sing.",
"So I said goodnight."
)
输出结果:'I had this thing.' 'That you could type up right.' "But it didn't sing." 'So I
said goodnight.'
输出发现第3个是双引号字符串,其他都是单引号字符。
请帮忙解释下,谢谢!
关注者
1
被浏览
没有找到相关结果
重要提示:提问者不能发表回复,可以通过评论与回答者沟通,沟通后可以通过编辑功能完善问题描述,以便后续其他人能够更容易理解问题.
1 个回复
悟 - 取是能力,舍是境界 2017-02-08 回答
赞同来自: xiaob786 、骑士不知道