turtle.degrees() function in Python
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
turtle.degrees()
This method is used to set angle measurement units to degrees. By default the angle measurement unit is “degrees”.
Syntax: turtle.degrees(fullcircle=360.0)
Parameter:
fullcircle(optional): a number. Set angle measurement units, i.e. set number of ‘degrees’ for a full circle. Default value is 360 degrees.
Below is the implementation of the above method with an example :
Python3
import turtle
turtle.speed( 1 )
turtle.forward( 100 )
turtle.left( 90 )
print (turtle.heading())
turtle.forward( 100 )
turtle.radians()
turtle.left( 1.57079633 )
print (turtle.heading())
turtle.forward( 100 )
turtle.degrees()
turtle.left( 90 )
print (turtle.heading())
|
Output :
Last Updated :
01 Aug, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...