The import statement involves two operations, it searches for a module and it binds the result of the search to name in local scope. When a module is imported, Python runs all of the code in the module file and made available to the importer file.

The turtle.speed() method is used to change the speed of the turtle by the value of the argument that it takes. Return or set the turtle’s speed.

The function Screen() returns a singleton object of a TurtleScreen subclass. This function should be used when turtle is used as a standalone tool for doing graphics. As a singleton object, inheriting from its class is not possible.

bgcolor(): This method is used to set or return background color of the Turtle Screen.

A for loop is used for iterating over a sequence.

The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number.

color(): This method is used to change the color of the turtle. The default color is black.

pensize():Set the line thickness to given possitive number or return it. If resizemode is set to “auto” and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned.

The turtle.left() method is used to change the direction of the turtle by the value of the argument that it takes. It gives the moving of the head of the turtle in a direction. The argument it takes is angle { a number (integer or float) }. So, it turns turtle left by angle units. (Units are by default degrees but can be set via the degrees() and radians() functions.) Angle orientation depends on the mode.

The turtle.forward() method is used to move the turtle forward by the value of the argument that it takes. It gives a line on moving to another position or direction The argument it takes is distance { a number (integer or float) }. So, it moves the turtle forward by the specified distance, in the direction the turtle is headed.