Easy Tutorial
❮ Ref Math Atan Python Func Frozenset ❯

Python3 degrees() Function

Python3 Numbers


Description

The degrees() function converts radians to degrees.


Syntax

Here is the syntax for the degrees() method:

import math

math.degrees(x)

Note: The degrees() function cannot be accessed directly; it requires importing the math module and calling this method through the math static object.


Parameters


Return Value

Returns a degree value.


Example

The following demonstrates the use of the degrees() method:

#!/usr/bin/python3
import math

print("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))

The output of the above example is:

degrees(3) :  171.88733853924697
degrees(-3) :  -171.88733853924697
degrees(0) :  0.0
degrees(math.pi) :  180.0
degrees(math.pi/2) :  90.0
degrees(math.pi/4) :  45.0

Python3 Numbers

❮ Ref Math Atan Python Func Frozenset ❯