python画喜羊羊代码
时间: 2023-11-08 11:01:18 浏览: 122
import turtle
# 设置画笔的颜色和大小
turtle.pensize(6)
turtle.pencolor("#F8BE00")
# 绘制喜羊羊的头部
turtle.circle(100)
# 绘制喜羊羊的眼睛
turtle.penup()
turtle.goto(-40, 120)
turtle.pendown()
turtle.circle(15)
turtle.penup()
turtle.goto(40, 120)
turtle.pendown()
turtle.circle(15)
# 绘制喜羊羊的嘴巴
turtle.penup()
turtle.goto(-70, 80)
turtle.pendown()
turtle.circle(70, 160)
# 绘制喜羊羊的身体
turtle.penup()
turtle.goto(-90, 0)
turtle.pendown()
turtle.circle(120, 180)
# 绘制喜羊羊的手
turtle.penup()
turtle.goto(-180, -80)
turtle.pendown()
turtle.circle(60, 120)
turtle.penup()
turtle.goto(90, -80)
turtle.pendown()
turtle.circle(60, -120)
# 绘制喜羊羊的脚
turtle.penup()
turtle.goto(-110, -220)
turtle.pendown()
turtle.circle(30, 180)
turtle.penup()
turtle.goto(40, -220)
turtle.pendown()
turtle.circle(30, 180)
# 绘制喜羊羊的尾巴
turtle.penup()
turtle.goto(-35, -180)
turtle.pendown()
turtle.seth(-60)
turtle.circle(80, -120)
# 绘制喜羊羊的眉毛
turtle.penup()
turtle.goto(-50, 150)
turtle.pendown()
turtle.goto(-30, 170)
turtle.penup()
turtle.goto(30, 170)
turtle.pendown()
turtle.goto(50, 150)
# 隐藏画笔
turtle.hideturtle()
# 结束绘制
turtle.done()
阅读全文