Create a function called sumto which takes an integer


Python 3 code needed:

Create a function called sumTo which takes an integer parameter and returns the total of all of the numbers from 1 to that number. For example, if the user entered a 5, the function would calculate 1 + 2 + 3 + 4 + 5 = 15. Keep prompting the user for a number until a zero (0) is entered. Use the following run as an example:

Enter a number: 5 sums to 15

Enter a number: 25 sums to 325

Enter a number: 100 sums to 5050

Enter a number: 0

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a function called sumto which takes an integer
Reference No:- TGS02512092

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)