turtle练习

一、等边三角形方法

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)

  

猜你喜欢

转载自www.cnblogs.com/python-cat/p/12372406.html