In the program below, we've used a recursive function recur_sum() to compute the sum up to the given number.
Source Code
Output
The sum is 136
Note: To test the program for another number, change the value of num.
Learn Python practically
and Get Certified.
To understand this example, you should have the knowledge of the following Python programming topics:
In the program below, we've used a recursive function recur_sum() to compute the sum up to the given number.
Output
The sum is 136
Note: To test the program for another number, change the value of num.