一、等边三角形方法
import turtle import time t = turtle.Turtle() def sanjiao(lenght,color): t.fillcolor(color) t.begin_fill() jiaodu = [240,120,120] for i in jiaodu: t.lt(i) t.fd(lenght) t.end_fill() sanjiao(100,"red") time.sleep(10)
一、等边三角形方法
import turtle import time t = turtle.Turtle() def sanjiao(lenght,color): t.fillcolor(color) t.begin_fill() jiaodu = [240,120,120] for i in jiaodu: t.lt(i) t.fd(lenght) t.end_fill() sanjiao(100,"red") time.sleep(10)