Python之turtle画小狗、狮子头和小黄人

源码

from turtle import *
import turtle as t
t.screensize(500, 500)
# 【头部轮廓】
t.pensize(5)
t.home()
t.seth(0)
t.pd()
t.color('black')
t.circle(20, 80)  # 0
t.circle(200, 30)  # 1
t.circle(30, 60)  # 2
t.circle(200, 29.5)  # 3
t.color('black')
t.circle(20, 60)  # 4
t.circle(-150, 22)  # 5
t.circle(-50, 10)  # 6
t.circle(50, 70)  # 7
# 确定鼻头大概位置
x_nose = t.xcor()
y_nose = t.ycor()
t.circle(30, 62)  # 8
t.circle(200, 15)  # 9
# 【鼻子】
t.pu()
t.goto(x_nose, y_nose + 25)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【眼睛】
t.pu()
t.goto(x_nose + 48, y_nose + 55)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【耳朵】
t.pu()
t.color('#444444')
t.goto(x_nose + 100, y_nose + 110)
t.seth(182)
t.pd()
t.circle(15, 45)  # 1
t.color('black')
t.circle(10, 15)  # 2
t.circle(90, 70)  # 3
t.circle(25, 110)  # 4
t.rt(4)
t.circle(90, 70)  # 5
t.circle(10, 15)  # 6
t.color('#444444')
t.circle(15, 45)  # 7
# 【身体】
t.pu()
t.color('black')
t.goto(x_nose + 90, y_nose - 30)
t.seth(-130)
t.pd()
t.circle(250, 28)  # 1
t.circle(10, 140)  # 2
t.circle(-250, 25)  # 3
t.circle(-200, 25)  # 4
t.circle(-50, 85)  # 5
t.circle(8, 145)  # 6
t.circle(90, 45)  # 7
t.circle(550, 5)  # 8
# 【尾巴】
t.seth(0)
t.circle(60, 85)  # 1
t.circle(40, 65)  # 2
t.circle(40, 60)  # 3
t.lt(150)
t.circle(-40, 90)  # 4
t.circle(-25, 100)  # 5
t.lt(5)
t.fd(20)
t.circle(10, 60)  # 6
# 【背部】
t
  • 8
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

BugMiaowu2021

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

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

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

打赏作者

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

抵扣说明:

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

余额充值