Cosine

Cosine by series
import sys import math x = float(sys.argv[1]) def cosine(x,y): cos = 0 for n in range (y): cos += ((-1)**n) * (x ** (2*n)) / (math.factorial(2 * n)) return cos for i in range (1,16): print (math.cos(x),cosine(x,i))
 * 1) !/usr/bin/python3