首页 > 其他 > 详细

字符串按照愿意输出

时间:2019-04-20 13:21:06      阅读:101      评论:0      收藏:0      [点我收藏+]
# 让字符串按照愿意输出
print(repr("hello\nworld"))
print("hello\\nworld")
print(r"hello\nworld")

结果

hello\nworld
hello\nworld
hello\nworld

 

字符串按照愿意输出

原文:https://www.cnblogs.com/alicelai1319/p/10740625.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!