使用turtle库绘制一个五边形螺旋线,并使用蓝色显示。用Python分别进行高水平和简单编译
时间: 2024-02-03 17:12:14 浏览: 76
如何使用python的自带turtle库.docx
高水平编译:
```python
import turtle
pen = turtle.Turtle()
pen.pencolor("blue")
for i in range(100):
pen.forward(i * 2)
pen.right(144)
turtle.done()
```
简单编译:
```python
import turtle
pen = turtle.Turtle()
pen.color("blue")
for i in range(100):
pen.forward(i * 2)
pen.right(144)
turtle.done()
```
阅读全文