Python : Turtle绘图-太极图(代码)

import turtle
def draw_TJT®:
turtle.screensize(800,600,“white”)
turtle.pensize(3)
turtle.pencolor(“black”)
turtle.speed(10)
TJT_color={1:“white”,-1:“black”}
color_list=[1,-1]
for c in color_list:
turtle.color(“black”,TJT_color.get©)
turtle.begin_fill()
turtle.circle(R/2,180)
turtle.circle(R,180)
turtle.circle(R/2,-180)
turtle.end_fill()
turtle.penup()
turtle.goto(0,R/3*c)
turtle.pendown()
turtle.fillcolor(TJT_color.get(-c))
turtle.begin_fill()
turtle.circle(-R/6,360)
turtle.end_fill()
turtle.penup()
turtle.goto(0,0)
turtle.pendown()
turtle.penup()
turtle.goto(0,-R-50)
turtle.pendown()
turtle.write("太极图 ",font=(“Arial”,12,“normal”))
turtle.mainloop()

if name==“main”:
draw_TJT(100)

你可能感兴趣的:(Python)