import turtle
import random
def drawSnow():
turtle.hideturtle()
turtle.pensize(2)
for i in range(100):
r, g, b = random.random(), random.random(), random.random()
turtle.pencolor((r, g, b))
turtle.penup()
turtle.setx(random.randint(-350, 350))
turtle.sety(random.randint(1, 270))
turtle.pendown()
dens = random.randint(8, 12)
snowsize = random.randint(10, 14)
for j in range(dens):
turtle.forward(snowsize)
turtle.backward(snowsize)
turtle.right(360/dens)
def drawGround():
turtle.hideturtle()
for i in range(400):
turtle.pensize(random.randint(5, 10))
x = random.randint(-400, 350)
y = random.randint(-280, -1)
r, g, b = -y/280, -y/280, -y/280
turtle.pencolor((r, g, b))
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
turtle.forward(random.randint(40, 100))
turtle.setup(800, 600, 200, 200)
turtle.tracer(False)
turtle.bgcolor("black")
drawSnow()
drawGround()
turtle.done()