【Python绘图】皮卡丘

        最近新学了turtle库,迫不及待编写了第一个小程序。虽然还有很多不足,但还是收获满满哈哈~~~

        废话不多说,上代码:

#皮卡丘
import turtle as t
t.screensize(600,600,"pink")
t.pensize(4)
#头部轮廓
t.penup()
t.fd(100)
t.pendown()
t.fillcolor("yellow")
t.begin_fill()
t.left(90)
t.circle(100,180)
t.right(30)
t.circle(50,90)
#左侧
t.seth(180)
t.circle(150,30)
t.seth(-30)
t.fd(70)
t.seth(70)
t.fd(40)
t.bk(100)
t.seth(150)
t.fd(20)
t.circle(10,180)
t.fd(40)
t.seth(0)
t.fd(140)
t.seth(120)
t.fd(30)
t.circle(-15,180)
t.fd(10)
#右侧
t.penup()
t.goto(100,0)
t.pendown()
t.seth(-70)
t.circle(-60,80)
t.seth(80)
t.fd(20)
t.seth(-150)
t.fd(70)
t.bk(70)
t.seth(-100)
t.fd(70)
t.seth(-60)
t.circle(-110,45)
t.circle(-25,150)
t.end_fill()
#眼睛
t.penup()
t.goto(-60,0)
t.pendown()
t.dot(40,"black")
t.dot(15,"white")
t.penup()
t.goto(40,-5)
t.pendown()
t.dot(45,"black")
t.dot(16,"white")
#右耳
t.penup()
t.goto(50,72)
t.pendown()
t.seth(15)
t.fd(60)
t.fillcolor("black")
t.begin_fill()
t.fd(60)
t.seth(-140)
t.fd(65)
t.end_fill()
t.fd(60)
#左耳
t.penup()
t.goto(-30,95)
t.pendown()
t.seth(70)
t.fd(35)
t.fillcolor("black")
t.begin_fill()
t.fd(50)
t.seth(-125)
t.fd(60)
t.end_fill()
t.fd(70)
#嘴巴
t.penup()
t.goto(-35,-35)
t.pendown()
t.fillcolor("red")
t.begin_fill()
t.seth(-60)
t.circle(10,90)
t.seth(-50)
t.circle(10,90)
t.seth(-120)
t.fd(22)
t.seth(120)
t.fd(25)
t.end_fill()
#尾巴
t.penup()
t.goto(80,-185)
t.pendown()
t.fillcolor("yellow")
t.begin_fill()
t.seth(5)
t.fd(30)
t.seth(85)
t.fd(25)
t.seth(10)
t.fd(30)
t.seth(105)
t.fd(28)
t.seth(33)
t.fd(55)
t.seth(115)
t.fd(18)
t.seth(90)
t.fd(50)
t.seth(-135)
t.fd(90)
t.seth(-75)
t.fd(50)
t.seth(-167)
t.fd(30)
t.seth(-80)
t.fd(25)
t.seth(-173)
t.fd(18)
t.end_fill()
#鼻子
t.penup()
t.goto(-15,-17)
t.pendown()
t.dot(8)
#署名
t.penup()
t.goto(220,-220)
t.pendown()
t.pencolor("white")
t.write("LD Yang",align="right",font=("Ink Free","19","normal"))
t.done()

        运行效果:

 

        以后会经常更新的~~~ 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值