Bob103

PY_#9

Jul 2nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. from math import *
  2. k = int(input("k="))
  3. x = int(input("x="))
  4. s=0
  5. for n in range(1,k):
  6.     s+=(pow(-1,n+1)*pow(x,2*n-1))/factorial(2*n-1)
  7.  
  8. print(s)
Advertisement
Add Comment
Please, Sign In to add comment