Try something like this:
import turtle
# create a screem
window = turtle.Screen()
#Set the background color
window.bgcolor("lightgreen")
#create turtle
turtle = turtle.Turtle()
# set turtle color
turtle.color("blue")
turtle.pensize(3)
# take input
sides = int(input("How many sides do you want? Use digits: "))
polygon(sides, length)
def polygon(sides,length):
for x in range(sides):
shape.forward(length)
shape.left(360/sides)