python小黄人

##小黄人

import turtle  # 调用turtle
turtle.setup(800,800)
turtle.speed(0)
turtle.up()
turtle.goto((150,150))
turtle.down()
turtle.left(90)

#身体
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.circle(150,180)
turtle.fd(300)
turtle.circle(150,180)
turtle.fd(300)
turtle.end_fill()

#两个大眼睛(黑)
turtle.up()
turtle.goto((0,150))
turtle.down()
turtle.width(5)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(40)
turtle.left(180)
turtle.circle(40)
turtle.end_fill()

#左边眼球(黑)
turtle.up()
turtle.goto((-30,150))
turtle.left(180)
turtle.down()
turtle.width(0)
turtle.fillcolor('#000000')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
#左边瞳孔(白)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(8)
turtle.end_fill()
#右边眼球(黑)
turtle.up()
turtle.goto((50,150))
turtle.down()
turtle.fillcolor('#000000')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
#右边瞳孔(白)
turtle.fillcolor('#ffffff')
turtle.begin_fill()
turtle.circle(8)
turtle.end_fill()
#右边黑色条框
turtle.up()
turtle.goto((80,160))
turtle.left(90)
turtle.down
turtle.fillcolor('#000000')
turtle.begin_fill()
turtle.circle(10,180)
turtle.fd(70)
turtle.circle(10,180)
turtle.fd(70)
turtle.end_fill()
#左边黑色条框
turtle.up()
turtle.goto((-150,160))
turtle.down
turtle.fillcolor('#000000')
turtle.begin_fill()
turtle.circle(10,180)
turtle.fd(70)
turtle.circle(10,180)
turtle.fd(70)
turtle.end_fill()
#嘴巴
turtle.up()
turtle.goto((-50,50))
turtle.down()
turtle.width(2)
turtle.pencolor('red')
turtle.left(135)
turtle.circle(80,100)
#裤子(不含吊带和口袋)
turtle.up()
turtle.left(35)
turtle.goto(150,-170)
turtle.pencolor('black')
turtle.down()
turtle.fillcolor('#3c78d8')
turtle.begin_fill()
turtle.fd(10)
turtle.left(90)
turtle.fd(50)
turtle.right(90)
turtle.fd(50)
turtle.left(90)
turtle.fd(200)
turtle.left(90)
turtle.fd(50)
turtle.right(90)
turtle.fd(50)
turtle.left(90)
turtle.fd(10)
turtle.circle(150,180)
turtle.end_fill()

#口袋
turtle.up()
turtle.goto(50,-150)
turtle.down()
turtle.left(90)
turtle.fd(100)
turtle.left(90)
turtle.fd(20)
turtle.circle(50,180)
turtle.fd(20)

#右吊带
turtle.up()
turtle.goto(150,-35)
turtle.down()
turtle.fillcolor('#3c78d8')
turtle.begin_fill()
turtle.goto(95,-110)
turtle.right(135)
turtle.fd(10)
turtle.goto(150,-50)
turtle.end_fill()
#左吊带
turtle.up()
turtle.goto(-150,-35)
turtle.down()
turtle.fillcolor('#3c78d8')
turtle.begin_fill()
turtle.goto(-95,-110)
turtle.right(90)
turtle.fd(10)
turtle.goto(-150,-50)
turtle.end_fill()

#四根毛(从右到左)
turtle.up()
turtle.home()
turtle.goto(20,300)
turtle.down()
turtle.left(85)
turtle.fd(80)

turtle.up()
turtle.home()
turtle.goto(5,300)
turtle.down()
turtle.left(88)
turtle.fd(65)

turtle.up()
turtle.home()
turtle.goto(-10,300)
turtle.down()
turtle.left(92)
turtle.fd(70)

turtle.up()
turtle.home()
turtle.goto(-20,300)
turtle.down()
turtle.left(97)
turtle.fd(80)

turtle.mainloop()
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值