python绘制多角星代码
时间: 2023-06-05 13:04:34 浏览: 386
python五角星代码
好的,以下是Python绘制五角星和六角星的代码:
绘制五角星:
```python
import turtle
star = turtle.Turtle()
for i in range(5):
star.forward(100)
star.right(144)
turtle.done()
```
绘制六角星:
```python
import turtle
star = turtle.Turtle()
for i in range(6):
star.forward(100)
star.right(60)
turtle.done()
```
希望可以帮到你!
阅读全文