python经典程序练习题11:叠加等边三角形的绘制

绘制如下图形:

源代码:

import turtle as t
t.pencolor("blue")  #笔触为蓝色
#绘制外部大三角形
t.fd(200)
t.seth(120)
t.fd(200)
t.seth(-120)
t.fd(200)
#绘制内部小三角形
t.seth(0)
t.fd(100)
t.seth(60)
t.fd(100)
t.seth(180)
t.fd(100)
t.seth(-60)
t.fd(100)
t.seth(120)
t.fd(100)
t.seth(0)
t.done()

猜你喜欢

转载自blog.csdn.net/qq_41149269/article/details/81096103