# Python program to convert degree to radian

Python example to convert degrees to radians and vice versa.

## Objective

Write a Python program to convert degrees to radians.

A radian is the measure of the central angle of a circle, whose arc length is the same as the radius of the circle.

1 radian is equal to 57.3 degrees.

## Method 1

Code

``````pi = 22/7
degrees = 5

radians = degrees * pi / 180

Output

``0.0873015873015873``

## Method 2 - Asking user input

Code

``````pi = 22/7
degrees = float(input("Input degrees ==> "))

radians = degrees * pi / 180

Output

``````Input degrees ==> 23
0.40158730158730155``````

## Method 3 - Using the math module

You can also use the `degrees` and `radians` functions from the `math` module.

1. Use `degrees` function to convert radians to degrees.
2. Use `radians` function to convert degrees to radians.

Code/Output

``````import math

math.degrees(0)
>>> 0.0

math.degrees(math.pi/2)
>>> 90.0

math.degrees(math.pi)
>>> 180.0

math.degrees(math.pi+(math.pi/2))
>>> 270.0

math.degrees(math.pi+math.pi)
>>> 360.0   ``````

Code/Output

``````#  Converting radians to degrees
import math

>>> 0.0

>>> 1.5707963267948966

>>> 3.141592653589793