Files
30-seconds-of-code/snippets/degrees_to_rads.md
2019-10-15 15:16:48 +03:00

326 B

title, tags
title tags
degrees_to_rads math,beginner

Converts an angle from degrees to radians.

Use math.pi and the degrees to radians formula to convert the angle from degrees to radians.

import math

def degrees_to_rads(deg):
  return (deg * math.pi) / 180.0
degrees_to_rads(180) # 3.141592653589793