图片:
clipboard.png
代码如下:

t = turtle.Turtle()
t.speed(0)
t.left(180)
for x in range(100):
    t.fd(x)
    t.right(72)
t.up()
t.fd(600)

彩色版本:

clipboard.png

import turtle
import random
t = turtle.Turtle()
t.speed(0)
list = ['green','red','purple','black','orange','yellow','blue','brown']
for x in range(100):
    color = random.choice(list)
    t.color(color)
    t.fd(x)
    t.left(72)
t.up()
t.fd(600)

Mixtual悦岚
47 声望3 粉丝

python矿粉,技术型宅,王者也666,爱分享