我有一个文本块,我想把它放在一个字符串中。当我粘贴文本时,我得到:
hello = "This paragraph forms
a block of text, which
can be short like this,
or extremely long!"
Python中哪个错误。有什么窍门吗?我正在使用带有Python插件的IntelliJ 2016.02社区。
答案 0 :(得分:1)
使用换行符:
mizzao:user-status
没有换行符
>>> hello = '''
... This paragraph forms
... a block of text, which
... can be short like this,
... or extremely long!'''
>>> print(hello)
This paragraph forms
a block of text, which
can be short like this,
or extremely long!
>>>