使用turtle库绘制一个蟒蛇形状的图形
#PythonDraw.py
import turtle
turtle.setup(650, 350, 200, 200)
turtle.penup()
turtle.fd(-250)
turtle.pendown()
turtle.pensize(25)
turtle.pencolor("purple")
turtle.seth(-40)
for i in range(4):
turtle.circle(40, 80)
turtle.circle(-40, 80)
turtle.circle(40, 80/2)
turtle.fd(40)
turtle.circle(16, 180)
turtle.fd(40 * 2/3)
turtle.done()
import turtle as t
t.pensize(10)
for i in range(4):
t.fd(100)
t.left(90)
t.done()
import turtle as t
t.pensize(10)
for i in range(6):
t.fd(100)
t.left(60) #角度改成60
t.done()
import turtle as t
t.pensize(5)
for i in range(9):
t.fd(150)
t.left(80) #也就是角度变了,多循环了几次
t.done()