实例2: Python蟒蛇绘制
作者:互联网
描述:
使用turtle库,绘制一个蟒蛇形状的图形。
输出示例
输出效果如下:
代码:
#PythonDraw.Py
import turtle as tr
tr.setup(650,350,200,200)
tr.penup()
tr.fd(-250)
tr.pendown()
tr.pensize(25)
tr.pencolor("purple")
tr.seth(-40)
for i in range(4):
tr.circle(40,80)
tr.circle(-40,80)
tr.circle(40,40)
tr.fd(40)
tr.circle(16,180)
tr.fd(40*2/3)
tr.done
标签:turtle,200,实例,Python,tr,40,蟒蛇,fd,circle 来源: https://blog.csdn.net/qq_36406673/article/details/89405890