CodePudding user response:
import turtle
Def the draw [color='green', startX=0, startY=100, L=100) :
Tu=turtle. The turtle ()
Tu. Hideturtle ()
Tu. Pensize (4)
Tu. Penup ()
Tu. Goto (x=startX, y=startY)
Tu. Pd ()
Tu. Begin_fill ()
For _ in range (3) :
Tu. Fd (L)
Tu. Left (120)
Tu. Fillcolor (color)
Tu. End_fill ()
If __name__=="__main__" :
Color=[' green ', 'red' and 'blue']
X1, y1, L=0, 100, 100
For _ in color:
The draw (_, x1, y1, L)
X1=x1 + L//2
Turtle. Mainloop ()
CodePudding user response:
The program can run normally