← Back to challenges

Radian to Degree

PythonHardmathlanguage_fundamentals

Instructions

Create a function that takes an angle in radians and converts it into degrees.

Examples

to_degree(math.pi) ➞ 180

to_degree(math.pi/2) ➞ 90

to_degree(math.pi/4) ➞ 45

Notes

  • The input angles are in radians.

  • There are 360 degrees and 2 pi radians in a circle. So to convert degrees to radians, divide by 360 and multiply by 2 * pi (approx. 6.28). Or equivalently, divide by 180 and multiply by pi.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Recursion: Length of a String