教你简单学会用Python画长草颜团子

相信大家都知道可爱的长草颜团子,它应该在很多人的表情包中占有一席之地,那么就今天我们试着用Python的turtle模板来画一个长草颜团子吧!

 

 这么可爱的团子谁不想要试着自己画出来呢哈哈哈

源码如下:

#8X_I
import turtle as t
t.pensize(3)
t.speed(10)
t.hideturtle()
t.penup()
t.fd(50)
t.pendown()
t.circle(100,120)
t.circle(200,120)
t.circle(100,120)
t.penup()
#身体
t.goto(-140,2)
t.right(120)
t.pendown()
t.circle(250,45)
t.penup()
t.goto(78,4)
t.right(-20)
t.pendown()
t.circle(-250,45)
t.penup()
#手
t.goto(-120,-20)#左手
t.right(-65)
t.pendown()
t.fd(50)
t.circle(-20,150)
t.fd(40)
t.penup()
t.goto(55,-30)#右手
t.right(30)
t.pendown()
t.circle(100,15)
t.circle(70,15)
t.circle(15,120)
t.circle(60,30)
t.fd(20)
t.penup()
#眼睛
t.goto(30,120)
t.dot(30,"black")
t.penup()
t.goto(-90,120)
t.pendown()
t.dot(30,"black")
t.penup()
#嘴巴
t.goto(-50,120)
t.right(70)
t.fd(5)
t.right(10)
t.pendown()
t.fd(10)
t.circle(2,5)
t.circle(5,30)
t.circle(12,180)
t.fd(5)
t.circle(12,5)
t.circle(2,5)
t.right(180)
t.fd(10)
t.circle(15,60)
t.circle(10,60)
t.circle(20,85)
t.penup()
#花
t.goto(-54,-160)
t.right(20)
t.pendown()
t.circle(-200,50)
t.circle(-200,10)
t.right(150)
t.color("black","red")
t.begin_fill()
t.circle(15,360)
t.left(72)
t.circle(15,360)
t.left(72)
t.circle(15,360)
t.left(72)
t.circle(15,360)
t.left(72)
t.circle(15,360)
t.end_fill()
t.penup()
#叶子
t.goto(-68,-30)
t.right(160)
t.pendown()
t.fillcolor ("green")
t.begin_fill()
t.circle(-100,30)
t.circle(-10,60)
t.circle(-20,90)
t.circle(-100,30)
t.fd(6)
t.end_fill()
t.penup()
t.goto(-68,-45)
t.right(160)
t.pendown()
t.right(10)
t.circle(250,10)
t.penup()
#头上的叶子
t.goto(-50,250)
t.left(90)
t.pendown()
t.right(20)
t.circle(-100,10)
t.begin_fill()
t.circle(-50,45)
t.circle(-10,180)
t.circle(-60,20)
t.circle(-50,10)
t.end_fill()
t.right(25)
t.begin_fill()
t.circle(-50,50)
t.circle(-10,180)
t.circle(-200,11)
t.end_fill()
t.done()

因为本人也算是Python的初学者吧,所以如果有什么需要改进的地方也希望大家可以提出来!

我也会尽量去改进的!

  • 12
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

8X_I

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值