动画

柔情痞子 提交于 2020-08-10 12:20:31

import turtle
import random
turtle.pensize(2)
turtle.screensize(800,600)
banjing = 200
jianju = 2
yanse = 'red'
speed = 5
turtle.penup()
turtle.goto(0,-200)
yanseArr = ['red','black','blue','yellow','green','gray','brown','white']









while(1==1):
banjing=random.randint(20,300)
jianju=random.randint(2,banjing)
yanse=yanseArr[random.randint(0,len(yanseArr)-1)]
speed=random.randint(20,40)
turtle.speed(speed)
turtle.pencolor(yanse)
for item in range(0,int(banjing/jianju)):
turtle.goto(0,-200+itemjianju)
turtle.pendown()
turtle.circle(banjing-item

jianju)
turtle.penup()
turtle.clear()









标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!