使用Python Turtle画一个小人发射爱心

最近刚开始学Python Turtle,尝试着画了一个发射爱心的小人,这是效果图:
在这里插入图片描述
以下是代码段:

import turtle as t
#画人的脑袋和躯干
t.speed(0)
t.penup()
t.goto(-100,100)
t.pendown()
t.pensize(3)
t.circle(50)
t.right(90)
t.forward(100)
t.right(45)
t.forward(70)
t.backward(70)
t.left(90)
t.forward(70)

#画人的小手
t.penup()
t.goto(-100,60)
t.pendown()
t.left(45)
t.forward(50)
t.right(45)
t.forward(45)
t.backward(45)
t.left(90)
t.forward(45)

#左眼
t.penup()
t.goto(-120,160)
t.pendown()
t.color('black')
t.begin_fill()
t.circle(5)
t.end_fill()

#右眼
t.penup()
t.goto(-80,160)
t.pendown()
t.color('black')
t.begin_fill()
t.circle(5)
t.end_fill()

#嘴
t.penup()
t.goto(-120,125)
t.pendown()
t.right(85)
t.circle(30,90)

#画心
t.penup()
t.goto(90,95)
t.pendown()
t.left(20)
t.color("red")
t.begin_fill()
t.circle(-35,210)
t.forward(65)
t.right(80)
t.forward(65)
t.circle(-35,210)
t.end_fill()
t.hideturtle()
t.done()
  • 7
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值