猫史档案馆


【Python作品分享】彩虹五角星【作品秀】

用户:a一只打工鸡a一只打工鸡查看:0 回复:0 评论:0 创建时间:2021-09-25T15:46:50


【作品展示】

center_image

 

【作品介绍】

彩虹五角星

本人Python小白,求大佬指点~

^_^

 

【作品源代码】

import turtle
import time
t = turtle.Turtle()
t.speed(0)
t.color("light blue")
steps = 10
counts = 0
cs = ['red', 'yellow', 'blue', 'green', 'orange', 'pink', 'brown', 'grey', 'black', 'light blue',"light green"]
color = 0
print('建议全屏海龟图哦!')
time.sleep(2)
while (counts <= 160):
    t.forward(steps)
    t.right(144)
    steps += 5
    color += 1
    if (color > 10):
        color = 0
    t.color(cs[color])
    counts += 1
time.sleep(1)
print("程序无错误,运行结束!")

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页