Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

math
python
radians
communitycreator

What is math.radians() in Python?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The radians() function in Python converts a value in degrees to the equal value in radians.

Figure 1 shows a mathematical representation of the radians() function.

Figure 1: Mathematical representation of radians() function

The math module is required for this function.

Syntax

radians(value)

Parameter

The radians() function takes a numberdegree value as a parameter.

Return value

The radians() function converts the value in degrees sent as a parameter to a value in radians.

Code

import math
#pi
print "The value of radians(180) : ", math.radians(180), "Radians"
#0
print "The value of radians(0) : ", math.radians(0), "Radians"
#-pi
print "The value of radians(-180) : ", math.radians(-180), "Radians"

RELATED TAGS

math
python
radians
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring