weixuan - 满天星练习(未完待续)

# 用变量,for循环,画一个蓝色blue的五角星
import turtle
import random
turtle.bgcolor('black')
turtle.color('white')
turtle.pensize(2)
changdu = 15
jiaodu = 144
turtle.speed(0)
# ctrl + c 复制
# ctrl + v 粘贴
# ctrl + x 剪切
# ctrl + z 撤销
turtle.color("yellow")
turtle.width(5)
for ai in range(100):
    for ai in range(5):
        turtle.fd(changdu)
        turtle.right(jiaodu)
    bb = random.randint(-350, 350)
    ss = random.randint(-350, 350)
    turtle.up()
    turtle.goto(bb, ss)
    turtle.down()

turtle.done()




发布了390 篇原创文章 · 获赞 19 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/104442020