Advertisement
UF6

Question 1 Final

UF6
May 8th, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import math
  2. x=float(input("Give x:"))
  3. n=term=numv=1000
  4. sum=1.0
  5.  
  6. while n<=1000:
  7.          term*=x/n
  8.          sum +=term
  9.           n+=1000
  10.           if term <0.0001:
  11.            break
  12. print ("No Values=%d and Sum=%f" %(n,sum))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement