目录
写在前面
用Python画一只可爱的小熊猫,期待你的支持~
完整代码
import turtle
# 设置初始画布和画笔
t = turtle.Turtle()
t.screen.delay(0)
turtle.setup(width=1.0, height=1.0)
turtle.bgcolor('white')
turtle.title("小熊猫")
t.speed(0)
t.rt(-120)
t.up()
t.pensize(6)
t.goto(180, 150)
t.down()
t.color('black')
# 头轮廓
t.circle(190, 100)
t.fd(20)
for i in range(260):
t.fd(1)
t.lt(0.5)
for i in range(8):
t.fd(19)
t.lt(1)
for i in range(260):
t.fd(1)
t.lt(0.5)
t.up