猫史档案馆


【Python作品分享】~~~~~~~万紫千红~~~~~~~【作品秀】

用户:比!太!阳!更!光!比!太!阳!更!光!查看:0 回复:0 评论:0 创建时间:2022-01-07T23:14:56


【作品展示】

center_image

 

【作品介绍】

没有~__~

 

【作品源代码】

# 准备工作
import turtle
import random
w=int(input('『输入初始圆的大小』(建议输入0):'))
turtle.hideturtle()
turtle.speed(0)
turtle.bgcolor("#666666")
#定义函数
def rd_color():
    hex_nums='0123456789abcdef'
    random.choice(hex_nums)
    col_str='#'
    for ii in range(6):
        col_str+=random.choice(hex_nums)
    return col_str
#定义函数
def have(q):
    f = 80
    turtle.pencolor(rd_color())
    turtle.forward(q)
    f=f+1
    turtle.right(f)
# 使用函数
turtle.pensize(4)
while True:
    have(w)
    w=w+1
turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页