Python:27画叮当猫—哆啦A梦

代码献上:

import turtle as t
# t.speed(5)
t.pensize(8)
t.hideturtle()
t.screensize(500, 500, bg='white')
# 猫脸
t.fillcolor('#00A1E8')
t.begin_fill()
t.circle(120)
t.end_fill()
t.pensize(3)
t.fillcolor('white')
t.begin_fill()
t.circle(100)
t.end_fill()
t.pu()
t.home()
t.goto(0, 134)
t.pd()
t.pensize(4)
t.fillcolor("#EA0014")
t.begin_fill()
t.circle(18)
t.end_fill()
t.pu()
t.goto(7, 155)
t.pensize(2)
t.color('white', 'white')
t.pd()
t.begin_fill()
t.circle(4)
t.end_fill()
t.pu()
t.goto(-30, 160)
t.pensize(4)
t.pd()
t.color('black', 'white')
t.begin_fill()
a = 0.4
for i in range(120):
    if 0 <= i < 30 or 60 <= i < 90:
        a = a + 0.08
        t.lt(3)  # 向左转3度
        t.fd(a)  # 向前走a的步长
    else:
        a = a - 0.08
        t.lt(3)
        t.fd(a)
t.end_fill()
t.pu()
t.goto(30, 160)
t.pensize(4)
t.pd()
t.color('black', 'whit
以下是使用Python叮当猫的示例代码: ```python import turtle # 设置布大小和背景颜色 turtle.setup(800, 600) turtle.bgcolor("white") # 设置笔颜色和粗细 turtle.pensize(3) turtle.pencolor("black") # 猫头 turtle.penup() turtle.goto(-50, 100) turtle.pendown() turtle.circle(100) # 眼睛 turtle.penup() turtle.goto(-30, 160) turtle.pendown() turtle.fillcolor("white") turtle.begin_fill() turtle.circle(20) turtle.end_fill() turtle.penup() turtle.goto(-70, 160) turtle.pendown() turtle.fillcolor("white") turtle.begin_fill() turtle.circle(20) turtle.end_fill() # 眼珠 turtle.penup() turtle.goto(-60, 170) turtle.pendown() turtle.fillcolor("black") turtle.begin_fill() turtle.circle(5) turtle.end_fill() turtle.penup() turtle.goto(-40, 170) turtle.pendown() turtle.fillcolor("black") turtle.begin_fill() turtle.circle(5) turtle.end_fill() # 鼻子 turtle.penup() turtle.goto(-50, 140) turtle.pendown() turtle.setheading(-30) turtle.fillcolor("red") turtle.begin_fill() turtle.circle(15, 180) turtle.end_fill() # 嘴巴 turtle.penup() turtle.goto(-50, 140) turtle.pendown() turtle.setheading(-60) turtle.circle(30, 120) turtle.penup() turtle.goto(-50, 140) turtle.pendown() turtle.setheading(60) turtle.circle(-30, 120) # 胡须 turtle.penup() turtle.goto(-70, 110) turtle.pendown() turtle.setheading(40) turtle.circle(-80, 80) turtle.penup() turtle.goto(-70, 110) turtle.pendown() turtle.setheading(140) turtle.circle(80, 80) turtle.penup() turtle.goto(-70, 110) turtle.pendown() turtle.setheading(100) turtle.circle(-80, 80) turtle.penup() turtle.goto(-70, 110) turtle.pendown() turtle.setheading(-40) turtle.circle(80, 80) # 身体 turtle.penup() turtle.goto(-50, 100) turtle.pendown() turtle.setheading(-30) turtle.fillcolor("white") turtle.begin_fill() turtle.circle(200, 180) turtle.circle(100, 180) turtle.left(90) turtle.forward(200) turtle.end_fill() # 脚 turtle.penup() turtle.goto(-150, -60) turtle.pendown() turtle.setheading(-90) turtle.fillcolor("white") turtle.begin_fill() turtle.forward(30) turtle.right(45) turtle.circle(80, -90) turtle.right(90) turtle.forward(30) turtle.end_fill() turtle.penup() turtle.goto(50, -60) turtle.pendown() turtle.setheading(-90) turtle.fillcolor("white") turtle.begin_fill() turtle.forward(30) turtle.left(45) turtle.circle(-80, -90) turtle.left(90) turtle.forward(30) turtle.end_fill() # 尾巴 turtle.penup() turtle.goto(20, -200) turtle.pendown() turtle.setheading(0) turtle.fillcolor("white") turtle.begin_fill() turtle.circle(20, 180) turtle.circle(10, 180) turtle.left(90) turtle.forward(20) turtle.end_fill() # 落款 turtle.penup() turtle.goto(-200, -250) turtle.pendown() turtle.write("自定义的精美的落款", align="center", font=("微软雅黑", 16, "bold")) # 隐藏笔 turtle.hideturtle() # 点击关闭窗口退出程序 turtle.exitonclick() ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

濯一一

你的鼓励:我最大的动力

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

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

打赏作者

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

抵扣说明:

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

余额充值