Answer:
# define main to get an argument from the user, call the function, and display the final values
def main():
# ask an argument from the user.
number = int(input('Enter a positive integer: '))
# solve the integral thing of the number by putting the user's argument in the addition() function
finalSum = addition(number)
# display the final value integral thing
print("The integral of this number is ", finalSum, ".")
# define an addition function to find the integral
def addition(num):
# make an if-statement to test filter things out of your calculations. In this case, 1.
if num == 1:
#if 1, return 1. because 1 + (1 - 1) = 1
return 1
# this is where the recursion actually is. This is the part that calculates
else:
return num + addition(num-1)
# call your main function
main()
Explanation:
This is written in Python. A link to the output can be found below.
https://Sum-of-Numbers.hufflepuffler07.repl.run