Easy Tutorial
❮ Python Linear Search Python String Max ❯

Python math.radians() Method

Python math Module

The math.radians(x) method in Python converts angle x from degrees to radians.

The math.degrees() method converts radian values to degrees.

Python Version: 2.0

Syntax

The syntax for the math.radians() method is as follows:

math.radians(x)

Parameter Description:

Return Value

Returns a floating-point number representing the radian value.

Example

The following example returns the radians for different degrees:

# Import math package
import math

# Output radians for degrees
print(math.radians(180))
print(math.radians(100.03))
print(math.radians(-20))

Output:

3.141592653589793
1.7458528507699278
-0.3490658503988659

Python math Module

❮ Python Linear Search Python String Max ❯