import turtle as t

from random import randint, random
from itertools import cycle



color = cycle(['green', 'purple', 'blue', 'orange', 'white', 'pink', 'aqua', 'lavender'])

def draw_star(points, size, col, x, y):
    t.penup()
    t.goto(x, y)
    t.pendown()
    angle = 180 - (180 / points)
    t.color(col)
    t.begin_fill()
    for i in range(points):
        t.forward(size)
        t.right(angle)
    t.end_fill()

# Main code

t.bgcolor(next(color))


while True:
    ranPts = randint(2, 5) * 2 + 1
    ranSize = randint(10, 50)
    ranCol = (random(), random(), random())
    ranX = randint(-350, 300)
    ranY = randint(-250, 250)
    
    draw_star(ranPts, ranSize, ranCol, ranX, ranY)


size = 300
poins = 5
angle = 180 - (180 / poins)


t.begin_fill()
for i in rangle(poins):
    t.forward(size)
    t.right(andle)
    
t.end_fill()
