Python Math degrees() Method
Python Math degrees() Converts radians to angles.
Python Math degrees() Syntax
The following is the syntax of the degrees() method:
import math
math.degrees(x)
Note: degrees() is not directly accessible, you need to import the math module and then call the method via the math static object.
Python Math degrees() Parameters
- x : A value.
Python Math degrees() Return Value
Return an angle value.
Python Math degrees() Example#1
The following shows an example of using the degrees() method.
#!/usr/bin/python3
import math
print ("degrees(9) : ", math.degrees(9))
print ("degrees(-9) : ", math.degrees(-9))
print ("degrees(0) : ", math.degrees(0))
print ("degrees(math.pi) : ", math.degrees(math.pi))
print ("degrees(math.pi/4) : ", math.degrees(math.pi/4))
print ("degrees(math.pi/8) : ", math.degrees(math.pi/8))
Output: