import turtle
# Create a turtle screen
screen = turtle.Screen()
# Create a turtle object
t = turtle.Turtle()
t.pencolor("pink")
# Function to draw a rectangle
def draw_rectangle(width, height):
for _ in range(2):
t.forward(width)
t.left(90)
t.forward(height)
t.left(90)
# Set turtle speed
t.speed(1)
# Position the turtle
t.penup()
t.goto(-50, -50) # Adjust these coordinates for the rectangle's position
t.pendown()
# Draw a rectangle with a width of 100 units and a height of 50 units
draw_rectangle(100, 50)
# Close the screen on click
screen.exitonclick()
To embed this program on your website, copy the following code and paste it into your website's HTML: