用Python画一只可爱的熊猫(附带源码)
import turtle as t
t.setup(width=1450, height=1450, startx=0, starty=0)
t.speed(0)
t.rt(-120)
t.up()
t.pensize(6)
t.goto(180, 150)
t.bgcolor('white')
t.title("My Panda")
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()
t.goto(-70, -16)
t.setheading(245)
t.down()
for i in range(35):
t.fd(1.5)
t.lt(0.5)
for i in range(5):
t.fd(1.5)
t.lt(0.0125)
for i in range(9):
t.fd(0.75)
t.lt(1.5)
for i in range(22):
t.fd(1)
t.lt(0.3)
for i in range(20):
t.fd(1)
t.lt(3)
for i in range(180):
t.fd(1)
t.lt(0.20)
for i in range(20):
t.fd(1)
t.lt(3)
for i in range(22):
t.fd(1)
t.lt(0.3)
for i in range(9):
t.fd(0.75)
t.lt(1.5)
for i in range(5):
t.fd(1.5)
t.lt(0.0125)
for i in range(25):
t.fd(1.5)
t.lt(0.5)
t.up()
t.goto