The main problem is that the “close” button on the tab doesn’t work.
turtle.exitonclick()
This code line tells the turtle to exit when the user clicks on the window.
Turtle Mainloop
The Turtle mainloop is a programming language that was designed to be easy to learn and use. It is popular for creating simple programs that can be run on a computer.