Hey,
I thought we should have a post for that purpose (using python 2.7.3)
I will begin with some and you're welcomed to add yours, please adopt the following form:
def sum(list): #Built in function
return reduce(lambda x, y: x+y, list)
def factorial(n): #Built in function
return reduce(lambda x, y: x*y, xrange(1,n+1)
def product(list): #Not built in
return reduce(lambda x, y; x*y, list)
def pow(i, j):
return i**j
def sin(a): # built in
pi = 3.14159265
x = (a*pi)/180 # x=a(in radians)
return x-((x**3)/factorial(3))+((x**5)/factorial(5))-((x**7)/factorial(7))
def cos(a):#built in
return 1-(sin(a)**2) # Fundamental relation of trigonometry,note: I already defined sin(a), i won't redefine it to compute cos(a)
def tan(a):#built in
return sin(a)/cos(a) # As i said above I already defined sin(a) and cos(a), tan(a) should be able to use those functions
That's enough for today, i'm sure most of you guys know them but please try to show some appreciation.
Thanks, out.