from turtle import *
from random import *
def snow():
hideturtle()
pensize(2)
for i in range(100):
r,g,b = random(),random(),random()
pencolor(r,g,b)
penup()
setx(randint(-350,350))
sety(randint(1,270))
pendown()
huaban = randint(8,12)
size = randint(10,14)
for i in range(huaban):
forward(size)
backward(size)
right(360/huaban)
def background():
hideturtle()
for i in range(400):
pensize(randint(5,10))
x = randint(-400,350)
y = randint(-280,-1)
r = g = b = -y/280
pencolor(r,g,b)
penup()
goto(x,y)
pendown()
forward(randint(40,100))
setup(800,600,200,200)
tracer(False)
bgcolor("black")
snow()
background()
down()