import turtle
def ll(c1,c2):
turtle.shape('turtle')
turtle.speed(9)
turtle.color("black",c1) # 边线的颜色 填充颜色
turtle.begin_fill() # 开始填充
turtle.circle(100,180)
turtle.circle(200,180)
turtle.lt(180)
turtle.circle(-100,180)
turtle.end_fill() # 结束填充
# 左转90°
turtle.lt(90)
# 抬笔
turtle.up()
# 向前走200 * 0.35
turtle.fd(200*0.35)
# 落笔
turtle.down()
turtle.rt(90)
# 给笔边的颜色和填充颜色
turtle.color(c1,c2)
# 填充
turtle.begin_fill()
turtle.circle(200*0.15)
turtle.end_fill()
turtle.rt(90)
turtle.up()
turtle.fd(200*0.35)
turtle.down()
turtle.rt(90)
ll('black','white')
ll('white','black')
# ll('yellow','green')
turtle.done()
harry - python画太极图
最新推荐文章于 2024-03-04 10:19:48 发布