בני*_*ילי 2 python printing ascii
我正在制作一个刽子手程序,如何在python中包含我的艺术而不在每行打印打印是否有多行打印,就像他们有多行注释一样?我不介意从文本文件中导入所有图片,无法从文档中找出这一点,感谢您的帮助.
def visual():
if count = 1:
## shows the hanging ascii art
Run Code Online (Sandbox Code Playgroud)
`
***************
* *
* *
* *
* *
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
***********************
Run Code Online (Sandbox Code Playgroud)
一个错误
***************
* *
* *
* *
* ....
* . ..
* .. .
* .. .
* .....
*
*
*
*
*
*
*
*
*
*
*
*
*
Run Code Online (Sandbox Code Playgroud)
两个错了
***************
* *
* *
* *
* ....
* . ..
* .. .
* .. .
* .....
* .
* .......
*
*
*
*
*
*
*
*
*
*
*
Run Code Online (Sandbox Code Playgroud)
`
Mar*_*ers 10
使用'''
或"""
三引号字符串文字:
longstring = """\
You can use multiple lines
and newlines
are preserved
"""
Run Code Online (Sandbox Code Playgroud)
我\
在打开tripple-quote之后使用了换行符,以避免在开头引号之后放置第一行.因此字符串从You
(在它之前没有换行符)开始:
>>> longstring = """\
... You can use multiple lines
... and newlines
... are preserved
... """
>>> print longstring
You can use multiple lines
and newlines
are preserved
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19628 次 |
最近记录: |