hdarwin

cstutoringcenter.com_Summations

Jan 7th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. def fun(n):
  2.     return (3.0*n+2)/(2.0*n+3)
  3. sum = 0
  4. for x in xrange(1,10001):
  5.     s = str(int(fun(x) * 1000))
  6.     sum += int(s[-1])
  7. print sum
Advertisement
Add Comment
Please, Sign In to add comment