# This program computes the approximate value of sin x # using finite number of terms of Taylor series import math def mySin(x): x = x%360 xR = math.pi*x/180.0 trm, sin = xR, xR for i in range(2,101): trm = -trm*xR*xR/((2*i-1)*(2*i-2)) sin = sin + trm return sin def main(): x = input("Enter the angle in degree: ") print "mySin(", x,") =", mySin(x) print "sin(", x,") =", math.sin(math.radians(x)) main()