Sanlover

Untitled

Oct 18th, 2021
812
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. x = float(input())
  3. summary = 1
  4. eps = 0.001
  5.  
  6. stepper = 2
  7. enumerator = x
  8. denomerator = 1.0
  9.  
  10. while True:
  11.     temp = enumerator / denomerator
  12.     summary += temp
  13.    
  14.     enumerator *= x
  15.     denomerator *= stepper
  16.     stepper += 1
  17.  
  18.     if abs(temp) < eps:
  19.         break
  20.  
  21. print(summary)
RAW Paste Data