fork download
  1. def Sum(natural_no):
  2. if(natural_no != 0):
  3. return natural_no + Sum(natural_no - 1)
  4. return 0
  5.  
  6. natural_number = 12
  7. print("The Total Sum Of",natural_number, "Natural Numbers Is:", Sum(12))
Success #stdin #stdout 0.04s 9716KB
stdin
Standard input is empty
stdout
The Total Sum Of 12 Natural Numbers Is: 78