Python画笑脸(朋友的头像)

源代码(最后面附有可执行文件,不用安装Python就可看到效果哦!)

#Sunshine_boy.py
import turtle as t
t.setup(700,650)
t.penup()
t.seth(180)
t.fd(23)
t.right(30)
t.pendown()
t.fillcolor("gold")
t.begin_fill()
t.fd(30)
#1
t.seth(30)
t.fd(30)
#2
t.seth(130)
t.fd(40)
t.seth(-10)
t.fd(30)
#3
t.seth(80)
t.fd(35)
t.seth(-30)
t.fd(25)
#4
t.seth(60)
t.fd(35)
t.seth(-45)
t.fd(30)
#5
t.seth(40)
t.fd(40)
t.seth(-80)
t.fd(35)
#6
t.seth(-10)
t.fd(35)
t.seth(-130)
t.fd(25)
#7
t.seth(-30)
t.fd(30)
t.seth(-130)
t.fd(30)
#8
t.seth(-60)
t.fd(30)
t.seth(-150)
t.fd(30)
#9
t.seth(-80)
t.fd(30)
t.seth(165)
t.fd(30)
#10
t.seth(-130)
t.fd(30)
t.seth(130)
t.fd(30)
#11
t.seth(-140)
t.fd(35)
t.seth(100)
t.fd(30)
#12
t.seth(-140)
t.fd(30)
t.seth(95)
t.fd(30)
#13
t.seth(159)
t.fd(35)
t.seth(30)
t.fd(37)
t.end_fill()
t.penup()
t.goto(41,-40)
t.seth(0)
t.pendown()
t.fillcolor("yellow")
t.begin_fill()
t.circle(60,360)
t.end_fill()
#嘴
t.left(90)
t.penup()
t.fd(30)
t.right(90)
t.pendown()
t.fillcolor("brown")
t.begin_fill()
t.circle(20,90)
t.left(45)
t.circle(5,90)
t.left(45)
t.circle(-10,180)
t.left(45)
t.circle(5,90)
t.left(45)
t.circle(20,90)
t.end_fill()
#左眼
t.penup()
t.left(90)
t.fd(40)
t.left(90)
t.fd(30)
t.pendown()
t.fillcolor("brown")
t.begin_fill()
t.circle(5,360)
t.end_fill()
#右眼
t.penup()
t.bk(50)
t.pendown()
t.fillcolor("brown")
t.begin_fill()
t.circle(5,360)
t.end_fill()
#右腮红
t.penup()
t.left(90)
t.fd(30)
t.seth(0)
t.right(45)
t.pendown
t.fillcolor("pink")
t.begin_fill()
t.circle(15,90)
t.circle(5,90)
t.circle(15,90)
t.circle(5,90)
t.end_fill()
#左腮红
t.penup()
t.seth(0)
t.bk(70)
t.right(45)
t.pendown
t.fillcolor("pink")
t.begin_fill()
t.circle(15,90)
t.circle(5,90)
t.circle(15,90)
t.circle(5,90)
t.end_fill()
#文字
t.penup()
t.seth(-90)
t.goto(65,-200)
t.pendown()
t.write("考研加油!\n",False,'center',font=('arial',30,'normal'))
t.write("你最棒!",False,'center',font=('arial',30,'normal'))
t.hideturtle()
t.done()

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值