Created
September 8, 2015 15:18
-
-
Save ri-sh/0a712d8712e163811e7e to your computer and use it in GitHub Desktop.
work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def factorial (n ): | |
if n<= 1 : | |
return 1 | |
fact = 1 | |
for i in range(1,n+1): | |
fact = fact*i | |
return fact | |
X=input('enter the value of x') | |
sum= 0 | |
for i in range (1,5): | |
k= (-1)**(i-1) | |
sum +=k*((X**i)/factorial(i)) | |
print sum | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment