代码
'''
画蟒蛇,换一种import方式,引用库中所有函数,这样使用 turtle 库时不用再加前缀
@Ref 2017.Python语言程序设计基础.第2版.嵩天, p48
@Version: v0.1, Python 3.9.5, Notus(hehe_xiao@qq.com), 2021.06.04
@Updated: 2021.06.04
'''
from turtle import *
setup(650, 350, 200, 200)
penup()
fd(-200)
pendown()
pensize(25)
pencolor("purple")
seth(-40)
for i in range(4):
circle(40, 80)
circle(-40, 80)
circle(40, 80/2)
fd(40)
circle(16, 180)
fd(40 * 2/3)
done()
输出
![](https://www.icode9.com/i/l/?n=20&i=blog/1101173/202106/1101173-20210603090156494-1579430049.png)