Describe
degrees () converts radians to angles.
Grammar
The following is the syntax for the degrees () method:
Import mathmath.degrees (x)
Note:degrees () is not directly accessible, you need to import the math module, and then call the method through the math static object.
Parameters
return value
Returns an angle value.
Instance
The following shows an example of using the degrees () method:
#!/usr/bin/python3import Mathprint ("degrees (3):", math.degrees (3)) print ("Degrees ( -3):", math.degrees (-3 ) Print ("degrees (0):", math.degrees (0)) print ("Degrees (Math.PI):", math.degrees (Math.PI)) print ("degrees (MATH.PI/2): ", math.degrees (MATH.PI/2)) print (" Degrees (MATH.PI/4): ", math.degrees (MATH.PI/4))
When the above instance is run, the output is:
Degrees (3): 171.88733853924697degrees ( -3): -171.88733853924697degrees (0): 0.0degrees (Math.PI): 180.0degrees (MATH.PI/2): 90.0degrees (MATH.PI/4): 45.0
Python degrees () function