📜  在 python turtle 中制作六边形 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.242000             🧑  作者: Mango

代码示例1
import turtle 

polygon = turtle.Turtle()

num_sides = 6
side_length = 70
angle = 360.0 / num_sides 

for i in range(num_sides):
    polygon.forward(side_length)
    polygon.right(angle)