python太极代码_Python : Turtle绘图-太极图(代码)

时间:2025-03-09 09:42:47

import turtle

def draw_TJT®:

(800,600,“white”)

(3)

(“black”)

(10)

TJT_color={1:“white”,-1:“black”}

color_list=[1,-1]

for c in color_list:

(“black”,TJT_color.get©)

turtle.begin_fill()

(R/2,180)

(R,180)

(R/2,-180)

turtle.end_fill()

()

(0,R/3*c)

()

(TJT_color.get(-c))

turtle.begin_fill()

(-R/6,360)

turtle.end_fill()

()

(0,0)

()

()

(0,-R-50)

()

("太极图 ",font=(“Arial”,12,“normal”))

()

if name==“main”:

draw_TJT(100)