fork(1) download
  1. def series_sum(n):
  2. if n==0:
  3. return 0
  4. else:
  5. return 1.0/((n+1.0)*(n+2.0))+series_sum(n-1.0)
  6.  
  7. print(series_sum(10))
  8. print(series_sum(100))
  9.  
  10.  
Success #stdin #stdout 0s 23296KB
stdin
Standard input is empty
stdout
0.416666666667
0.490196078431