Python-利用海龟库输出以下图形

利用海龟库输出以下图形

Python-利用海龟库输出以下图形_第1张图片

import turtle
turtle.setup(650, 350,200, 200)
a=["white","yellow","magenta","cyan","blue","black","cyan"]
turtle.penup()
turtle.fd(-250)
turtle.pendown()
turtle.pensize(25)
turtle.pencolor("purple")
turtle.seth(-40)
for i in range(7):
    turtle.circle(40, 80)
    turtle.circle(-40, 80)
    turtle.pencolor(a[i])
turtle.circle(40, 80/2)
turtle.fd(40)
turtle.circle(16, 180)
turtle.fd(40 * 2/3)
turtle.done()

你可能感兴趣的:(python题目集,python,开发语言)