文件名称:ZigZag:使用tryexcept循环打动您的祖母
文件大小:2KB
文件格式:ZIP
更新时间:2024-04-23 20:26:54
Python
之字形 简短的python脚本,可让以前从未打开过终端机的人惊叹不已。 使用短无限循环,我们可以绘制一些整齐的图案。 import time import traceback 需要时间模块来指示循环迭代的速度。 无需追溯,但是我想确切地知道如果发生故障,出了什么问题。 # Current space counter spacing = 0 # True = add to space counter, False = subtract from space counter incrementSpacing = True # Forward pattern forward = ' \\ \\ \\ \\ \\ ' # Backward pattern back = '/////' 'spacing'变量指示模式之前有多少空格。 我们的循环会调整空间,以使图案看起来像是曲折形的。 “ i
【文件预览】:
ZigZag-main
----README.md(3KB)
----zigzag.py(700B)