请用python代码实现一只布偶猫
时间: 2023-02-20 08:21:20 浏览: 69
您可以使用Python代码来模拟一只布偶猫:
import turtle
t = turtle.Turtle()
t.shape('turtle')
t.color('light pink')
t.fillcolor('light pink')
t.shapesize(2,2,2)
t.penup()
t.goto(-100,0)
t.pendown()
# 画头部
t.fill(True)
t.circle(50)
t.fill(False)
# 画眼睛
t.penup()
t.goto(-50,50)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
t.penup()
t.goto(-70,50)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
# 画嘴巴
t.penup()
t.goto(-50,20)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(20,180)
t.end_fill()
# 画耳朵
t.penup()
t.goto(-90,90)
t.pendown()
t.fillcolor('light pink')
t.begin_fill()
t.circle(20,180)
t.end_fill()
t.penup()
t.goto(-10,90)
t.pendown()
t.fillcolor('light pink')
t.begin_fill()
t.circle(20,180)
t.end_fill()
# 画脚
t.penup()
t.goto(-40,-50)
t.pendown()
t.fillcolor('light pink')
t.begin_fill()
t.circle(20,180)
t.end_fill()
t.penup()
t.goto(20,-50)
t.pendown()
t.fillcolor('light pink')
t.begin_fill()
t.circle(20,180)
t.end_fill()