绘制可爱的笑脸
功能要求
使用海龟绘图画可爱的笑脸
说明:笑脸主要由三个圆形和一个弧线组成。笑脸的脸为黄色的圆形,眼睛为两个黑色圆形,嘴为黑色的弧线。
实例代码
import turtle
t = turtle.Pen()
t.hideturtle()
t.color('red','yellow')
t.begin_fill()
t.circle(50)
t.end_fill()
t.penup()
t.goto(-20, 50)
t.pendown()
t.color('yellow', 'black')
t.begin_fill()
t.circle(10)
t.end_fill()
t.penup()
t.goto(20, 50)
t.pendown()
t.color('yellow', 'black')
t.begin_fill()
t.circle(10)
t.end_fill()
t.penup()
t.goto(-20, 30)
t.pendown()
t.right(45)
t.color('black')
python

于 2022-05-10 14:18:32 发布 · 3.3k 阅读