Methods used by the turtle —
|forward (no. of steps)||This function is used to move the turtle forward the specified number of steps.|
|backward (no. Of steps)||This function is used to move the turtle forward the specified number of steps.|
|left (angle)||This function is used to rotate the turtle left / anti-clockwise with the specified angle .|
|right (angle)||This function is used to rotate the turtle right / clockwise with the specified angle.|
position () & # 8212 ; this function is used to get the coordinates / position of the turtle pointer. No parameters are required here, as this function is not used for input, but is used to output the position of the turtle in the console window.
Function Description bgcolor (“color”) This function is used to give background color to the turtle window. pencolor (“color”) This function is used to give color to the turtle pen. fillcolor (“color”) This function is used to fill color in any closed shape. color (pencolor, fillcolor) This is a shorthand function used to assign pencolor and fillcolor at the same time. td >
|penup () or pu ()||This function is used to lift pen from th e current position.|
|goto ()||This function is used to move the pen to a new location after lifting.tr >|
|pendown () or pd ()||This function is used again put down the pen to a new location.|
|pensize (int)||This function is used to specify the width of the line drawn by pen.|
Note: To learn more about the turtle, Output:
# Python program for
# demonstrate the basics of a turtle
# Import and make a turtle object code >
# with white background
turtle.Screen (). bgcolor (
" White "
d raw.forward (
draw .right (
draw. forward (
Now that we`ve covered the basics of the turtle, let`s write the code to print "HELLO". Below is the implementation.