例4等边三角形
Python
import turtle #使用import语句导入turtle绘图库
turtle.forward(150) #画笔前进150,画第一条边
turtle.right(120) #向右旋转120度
turtle.forward(150) #画第二条边
turtle.right(120) #第二次向右旋转120度,
turtle.forward(150) #画第三条边
import turtle #使用import语句导入turtle绘图库
turtle.forward(150) #画笔前进150,画第一条边
turtle.right(120) #向右旋转120度
turtle.forward(150) #画第二条边
turtle.right(120) #第二次向右旋转120度,
turtle.forward(150) #画第三条边