Write a Python program to convert radian to degree


This Python code converts a radian value to its equivalent in degrees. Here's an explanation of each part of the code:

  • import math: This line imports the math module, which provides various mathematical functions and constants.
  • radian = float(input("Enter Radian value : ")): This line prompts the user to enter a radian value and stores it as a floating-point number in the variable radian.
  • degree = math.degrees(radian): This line calculates the equivalent degree value for the entered radian. It uses the math.degrees() function from the math module, which takes a radian value as input and returns its degree equivalent.
  • print("Radian to Degree : ", degree): Finally, this line prints the result, which is the degree value corresponding to the radian value entered by the user. The text "Radian to Degree" is included in the output to clarify the unit of measurement.

Overall, this code takes a radian value as input, converts it to degrees using the math.degrees() function, and then prints the converted value. It's useful for converting angles between different units when working with trigonometric calculations and geometry in mathematics and science

Source Code

import math
 
# Input radian value
radian = float(input("Enter Radian value : "))
 
# Convert radians to degrees
degree = math.degrees(radian)
print("Radian to Degree : ",degree)

Output

Enter Radian value : 2
Radian to Degree :  114.59155902616465

Example Programs