Python 画多角形

2025-10-04 09:27:45

1、turtle.forward(150)

 turtle.right(180-180/7)

turtle.forward(150)

直行多少步,然后再右转多少度,180-180/7我是打算画7个角所以就用这样算式,想画多少都可以的。再直行

Python 画多角形

2、> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> turtle.right(180-180/7)

>>> turtle.forward(150)

>>> 

这样就画成了

Python 画多角形

1、以后想画什么样的都可以了

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢