长字符的输出

来源:互联网 发布:破解网络手游下载平台 编辑:程序博客网 时间:2024/04/29 00:35

#分行输出

>>> print '''this is very long string.

... it continues here.
... it's not over yet.
... "hello world" '''
this is very long string.
it continues here.
it's not over yet.
"hello world" 


#一行输出

>>> print "this is very long string.\
... it's not over yet.\
... 'hello world' "
this is very long string.it's not over yet.'hello world' 

>>> 

print r"hello\nworld"print "hello\nworld"print '\''print u"hello world"


hello\nworld

hello
world
'
hello world

原创粉丝点击