Python Function Reference

math.degrees

Convert an angle from radians to degrees.

Python 3.13
math.degrees(x)
x
The angle in radians.
int | float

Return value

The angle in degrees as a float.

Examples

Converting pi radians to degrees

Python 3.13
import math
print(math.degrees(math.pi))
180.0

Angle from a tangent value

Python 3.13
import math
print(math.degrees(math.atan(1)))
45.0

Details

The inverse function is math.radians. It is handy for showing in degrees the result of inverse trigonometric functions such as math.atan, which return an angle in radians.

See also