Python Tutorial Python Advanced Python References Python Libraries

Python math - degrees() Function



The Python math.degrees() function returns an angle measured in radians to an approx. equivalent angle measured in degrees.

Syntax

math.degrees(arg)

Parameters

arg Required. Specify an angle in radians.

Return Value

Returns the angle measured in degrees.

Example:

In the example below, degrees() function returns an angle measured in radians into angle measured in degrees.

import math

pi = math.pi
print(math.degrees(pi/6))
print(math.degrees(pi/3))
print(math.degrees(pi/2))
print(math.degrees(pi))

The output of the above code will be:

29.999999999999996
59.99999999999999
90.0
180.0

❮ Python Math Module