python
weixin_47039451
这个作者很懒,什么都没留下…
展开
-
使用python turtle库代码实现奥运五环(带遮挡关系)
话不多说,直接上代码 import turtle turtle.setup(1080,720) turtle.pensize(18) turtle.penup() # 首圆起点 turtle.goto(-200,-100) # 绘制蓝色的圆 turtle.pencolor(.1,.6,.8) turtle.pendown() turtle.circle(100,-345) # 抬笔,去第二个圆的位置 turtle.penup() turtle.goto(-84,-20) # 橙色圆 turtle原创 2020-07-23 13:48:47 · 726 阅读 · 0 评论 -
使用python turtle库13行代码实现奥运五环
网上看到很多关于画奥运五环的python代码,但大多是采用一个个地画地方式,整体代码显得很累赘,故此我使用for循环简化了代码,用了不到15行python代码完成了奥运五环的绘制,下面贴代码 # 引入turtle画图库 import turtle # 设置笔画粗细为20像素 turtle.pensize(20) # 将奥运五环的颜色保存到数组中 color = ['blue','black','red','yellow','green'] for i in range(5): # 画每个新的圆前将画笔抬原创 2020-07-22 15:14:25 · 3325 阅读 · 3 评论