摘要: # 字符串格式设置实例 # 根据指定的宽度打印格式良好的价格列表 width = int(input('Please enter width:')) price_width = 10 item_width = width - price_width header_fmt = '{{:{}}}{{:{}}}'.format(item_width, price_width) fmt = '{... 阅读全文
posted @ 2018-12-19 23:31 子觉 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 简单的绘图工具 海龟绘图(Turtle Graphics) 使用海龟绘图首先我们需要导入turtle: 海龟绘图属性: (1)位置 (2)方向 (3)画笔(画笔的属性,颜色、画线的宽度) 操纵海龟绘图有着许多的命令,这些命令可以划分为两种:一种为运动命令,一种为画笔控制命令 (1)运动命令: 1 f 阅读全文
posted @ 2018-12-19 22:22 子觉 阅读(1695) 评论(0) 推荐(0) 编辑