30 seconds of python

  Back to Home

degrees_to_rads

mathbeginner

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