>>> print(("hello\nworld", "hello2"))
('hello\nworld', 'hello2')
如何使它打印出来:
('hello
world', 'hello2')
我的意思是它不能将 \n
打印为符号,而是要实现这个符号并换行。
Python版本为 3.4
。
我尝试使用 pprint
但它做了同样的事情:
>>> import pprint
>>> pp = pprint.PrettyPrinter(indent=4)
>>> pp.pprint(("hello\nworld"))
'hello\nworld'