字符串按照愿意输出

# 让字符串按照愿意输出
print(repr("hello\nworld"))
print("hello\\nworld")
print(r"hello\nworld")

结果

'hello\nworld'
hello\nworld
hello\nworld

猜你喜欢

转载自www.cnblogs.com/alicelai1319/p/10740625.html