Python 2.7 如何在多行上分隔打印命令

Python 2.7 如何在多行上分隔打印命令,python-2.7,Python 2.7,我想写一长串文本,并在编写代码时将其分成两行,但在代码运行时,我希望该行显示为一行 side1 = raw_input('Enter the length of the first side, of the triangle: ') 因此,我想在文本编辑器中开始一行新的逗号,但是当代码在python中运行时,我希望问题显示为一行。抱歉造成混淆。您可以使用\n(换行符)字符: side1 = raw_input('Enter the length of the first side,\n of

我想写一长串文本,并在编写代码时将其分成两行,但在代码运行时,我希望该行显示为一行

side1 = raw_input('Enter the length of the first side, of the triangle: ') 

因此,我想在文本编辑器中开始一行新的逗号,但是当代码在python中运行时,我希望问题显示为一行。抱歉造成混淆。

您可以使用
\n
(换行符)字符:

side1 = raw_input('Enter the length of the first side,\n of the triangle: ') 

\n
表示新行,而
\t
表示水平空间(制表)

如果我理解你的新公式,是的,可能是这样

简单地把你的新线像那样放在父母之间

side1 = raw_input('Enter the length of the first side,'
                  ' of the triangle: ') 

您是否尝试过side1=raw_输入(“输入三角形第一条边的长度:”)?对不起,我之前的问题不清楚,我已经编辑了,希望现在更清楚。
side1 = raw_input('Enter the length of the first side,'
                  ' of the triangle: ')