python绘画彩色螺旋线
时间: 2023-12-10 22:36:17 浏览: 102
以下是Python绘制彩色螺旋线的代码和效果展示:
```python
import turtle
turtle.speed(10)
turtle.pensize(2)
turtle.bgcolor("white")
colors = ["red", "yellow", "purple", "blue", "green"]
for x in range(700):
turtle.forward(x + 1)
turtle.color(colors[x % 5])
turtle.left(91)
turtle.done()
```
阅读全文