python turtle画熊猫人_用Python Turtle 画可爱的熊猫

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(-65, -119)

t.down()

t.begin_fill()

t.color('black')

t.setheading(280)

t.circle(30, 135)

t.end_fill()

t.up()

t.goto(50, -129)

t.down()

t.begin_fill()

t.color('black')

t.setheading(305)

t.circle(30, 135)

t.end_fill()

t.up()

t.goto(200, 118)

t.down()

t.begin_fill()

t.color('black')

t.setheading(20)

t.circle(50, 210)

t.end_fill()

t.up()

t.goto(-70, 227)

t.down()

t.begin_fill()

t.color('black')

t.setheading(103)

t.circle(50, 230)

t.end_fill()

t.up()

t.goto(117, -40)

t.setheading(25)

t.down()

t.begin_fill()

t.color('black')

for i in range(70):

t.fd(1)

t.lt(-0.5)

for i in range(160):

t.fd(0.25)

t.lt(-0.9)

for i in range(70):

t.fd(1)

t.lt(-0.65)

t.end_fill()

t.up()

t.goto(-75, -25)

t.setheading(155)

t.down()

t.begin_fill()

t.color('black')

for i in range(70):

t.fd(1)

t.lt(0.5)

for i in range(160):

t.fd(0.25)

t.lt(0.85)

for i in range(70):

t.fd(1)

t.lt(0.65)

t.end_fill()

t.up()

t.goto(-45, 80)

t.begin_fill()

t.color('black')

t.down()

t.circle(25.25)

t.end_fill()

t.up()

t.goto(-50.5, 74.5)

t.begin_fill()

t.color('black')

t.down()

t.circle(26.25)

t.end_fill()

t.up()

t.goto(-43, 100)

t.begin_fill()

t.color('white')

t.down()

t.circle(5.5)

t.end_fill()

t.up()

t.goto(100, 67)

t.begin_fill()

t.color('black')

t.down()

t.circle(25.25)

t.end_fill()

t.up()

t.goto(105.5, 63.5)

t.begin_fill()

t.color('black')

t.down()

t.circle(25.25)

t.end_fill()

t.up()

t.goto(96, 92)

t.begin_fill()

t.color('white')

t.down()

t.circle(5.5)

t.end_fill()

t.up()

t.goto(105, 40)

t.begin_fill()

t.color('tomato')

a = 0.45

t.down()

t.setheading(270)

for i in range(120):

if 0 <= i < 30 or 60 <= i < 90:

a = a+0.045

t.lt(3)

t.fd(a)

else:

a = a-0.045

t.lt(3)

t.fd(a)

t.end_fill()

t.up()

t.goto(-60, 50)

t.begin_fill()

t.color('tomato')

a = 0.4

t.down()

t.setheading(90)

for i in range(120):

if 0 <= i < 30 or 60 <= i < 90:

a = a+0.04

t.lt(3)

t.fd(a)

else:

a = a-0.04

t.lt(3)

t.fd(a)

t.end_fill()

t.up()

t.goto(20, 75)

t.begin_fill()

t.color('black')

t.setheading(125)

t.down()

for i in range(25):

t.fd(0.75)

t.lt(-1)

for i in range(20):

t.fd(0.25)

t.lt(-4.5)

for i in range(30):

t.fd(0.75)

t.lt(-1)

for i in range(20):

t.fd(0.25)

t.lt(-4.5)

for i in range(25):

t.fd(0.75)

t.lt(-1)

for i in range(20):

t.fd(0.25)

t.lt(-4.5)

t.end_fill()

t.up()

t.setheading(260)

t.goto(23, 75)

t.down()

for i in range(45):

t.fd(1)

t.lt(3)

t.up()

t.setheading(260)

t.goto(23, 75)

t.down()

for i in range(45):

t.fd(1)

t.lt(-3)

t.color('red')

x = -100

t.up()

t.goto(x, 300)

t.down()

t.write('I', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('orange')

x = x + 25

t.goto(x, 300)

t.down()

t.write('l', align='center', font=('Arial', 30, 'bold'))

t.up()

x = x + 13

t.color('gold')

t.goto(x, 300)

t.down()

t.write('o', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('green')

x = x + 15

t.goto(x, 300)

t.down()

t.write('v', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('lime')

x = x + 15

t.goto(x, 300)

t.down()

t.write('e', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('blue')

x = x + 30

t.goto(x, 300)

t.down()

t.write('m', align='center', font=('Arial', 30, 'bold'))

t.up()

x = x + 20

t.color('purple')

t.goto(x, 300)

t.down()

t.write('y', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('black')

x = x + 30

t.goto(x, 300)

t.down()

t.write('P', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('grey')

x = x + 17

t.goto(x, 300)

t.down()

t.write('a', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('black')

x = x + 17

t.goto(x, 300)

t.down()

t.write('n', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('grey')

x = x + 17

t.goto(x, 300)

t.down()

t.write('d', align='center', font=('Arial', 30, 'bold'))

t.up()

t.color('black')

x = x + 17

t.goto(x, 300)

t.down()

t.write('a', align='center', font=('Arial', 30, 'bold'))

t.ht()

t.done()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值