绘制叠加等边三角形

import turtle
turtle.pencolor("blue")
#绘制外部大三角形
turtle.fd(200)
turtle.seth(120)
turtle.fd(200)
turtle.seth(-120)
turtle.fd(200)
#绘制内部小三角形
turtle.seth(0)
turtle.fd(100)
turtle.seth(60)
turtle.fd(100)
turtle.seth(180)
turtle.fd(100)
trutle.seth(-60)
turtle.fd(100)
turtle.seth(120)
turtle.fd(100)
turtle.seth(0)
trutle.done()

猜你喜欢

转载自www.cnblogs.com/Dengyaling/p/12497432.html