Python基础任务6

turtle库——精灵球

from turtle import*


setup(800, 800)
hideturtle()
speed(10)
pensize(12)

# 上半部分
begin_fill()
fillcolor(1, 0, 0)
penup()
fd(-200)
pendown()
fd(400)
left(90)
circle(200, 180)
end_fill()

# 下半部分
circle(200, 180)

# 中间按钮
right(90)
penup()
goto(0, -60)
pendown()
begin_fill()
fillcolor(1, 1, 1)
circle(60, 360)
end_fill()

penup()
goto(0, -30)
pensize(6)
pendown()
begin_fill()
fillcolor(1, 1, 1)
circle(30, 360)
end_fill()

done()

精灵球

猜你喜欢

转载自blog.csdn.net/qq_42263613/article/details/89207440
今日推荐