如何禁用换行?

时间:2017-05-16 05:27:49

标签: python escaping python-3.6

如何在python3.6字符串中禁用\n的新行行为? 例如:

In:  >>> a = input("Please enter a sentence: ")
Out: blah blah \n blah

In:  >>> print(a)
Out: blah blah \n blah

2 个答案:

答案 0 :(得分:1)

根据documentation;

id

答案 1 :(得分:-5)

a =输入(“请输入句子:”)
k = list(str(a))
e =''。join(k)
打印(e)中