在Python中打印行

1 投票
1 回答
1436 浏览
提问于 2025-04-16 16:38

我想知道在Python中怎么像这样打印多行

print " text here
text here

text here

line here"

我正在尝试使用cgi,这样我就不需要对每一行都使用print来打印了

谢谢

1 个回答

2

使用三重引号字符串

print( """
Something 
You 
can
print
multi-line
""")

撰写回答