sin() and cos()

Consider the following code which will print out the value of trigonometric functions sin() and cos(). Please note that in Python, the function sin() and cos() in the math module expect the input parameter to be represented in radians, instead of degrees which we are familiar with. Therefore, you must convert degrees to radians with the function math.radians(x), or the formula radian = degree * math.pi / 180.

import math
for degree in range (0, 360, 15):
    radian = math.radians(degree)
    print(degree, math.sin(radian), math.cos(radian))

However, the output of the above code looks ugly. Please use the string formatting skills you learned to align the output as follows.

Degree    sin()   cos()
=======================
  0      0.0000  1.0000
 15      0.2588  0.9659
 30      0.5000  0.8660
 45      0.7071  0.7071
 60      0.8660  0.5000
 75      0.9659  0.2588
 90      1.0000  0.0000
105      0.9659 -0.2588
120      0.8660 -0.5000
135      0.7071 -0.7071
150      0.5000 -0.8660
165      0.2588 -0.9659
180      0.0000 -1.0000
195     -0.2588 -0.9659
210     -0.5000 -0.8660
225     -0.7071 -0.7071
240     -0.8660 -0.5000
255     -0.9659 -0.2588
270     -1.0000 -0.0000
285     -0.9659  0.2588
300     -0.8660  0.5000
315     -0.7071  0.7071
330     -0.5000  0.8660
345     -0.2588  0.9659