python turtle画狮子头
时间: 2023-12-11 11:33:53 浏览: 42
以下是使用Python turtle绘制狮子头的代码和步骤:
```python
import turtle
# 设置画笔
t = turtle.Pen()
t.speed(0)
t.pensize(5)
# 绘制头部
t.fillcolor('orange')
t.begin_fill()
t.circle(100)
t.end_fill()
# 绘制鼻子
t.penup()
t.goto(0, 50)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(20)
t.end_fill()
# 绘制眼睛
t.penup()
t.goto(-30, 120)
t.pendown()
t.fillcolor('white')
t.begin_fill()
t.circle(30)
t.end_fill()
t.penup()
t.goto(-30, 130)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
t.penup()
t.goto(30, 120)
t.pendown()
t.fillcolor('white')
t.begin_fill()
t.circle(30)
t.end_fill()
t.penup()
t.goto(30, 130)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
# 绘制嘴巴
t.penup()
t.goto(-60, 20)
t.pendown()
t.right(45)
t.circle(80, 90)
# 完成绘制
t.hideturtle()
turtle.done()
```