python绘制正六边形

图在这
python绘制正六边形_第1张图片
代码在这

import turtle
turtle.penup()
turtle.goto(-90,90)
turtle.pendown()
turtle.pensize(1)
turtle.pencolor("red")
for i in range(3):
    turtle.fd(180)
    turtle.right(120)
turtle.right(60)
turtle.fd(60)
turtle.right(60)
turtle.fd(60)
turtle.seth(60)
for i in range(3):
    turtle.fd(180)
    turtle.right((120))
turtle.done()

你可能感兴趣的:(python基础,python)