Question: Python Write a function called sumTo that takes as arguments two numbers. Your function should use a loop to sum all of the numbers between

Python Write a function called sumTo that takes as arguments two numbers. Your function should use a loop to sum all of the

numbers between the two (This includes the starting and ending numbers) and return the sum. Required Your function must allow

for either argument to be larger. For instance, passing 5, 1 should yield the same as passing 1, 5. Setting the order of the

numbers must be done within the sumTo function. You are allowed to use one loop and no decisions within that loop. This means

that the order of the arguments must be taken care of prior to the beginning of the loop. What not to do global variables Using

print in the sumTo function Using input in the sumTo function From main ask the user for two numbers, call the function, and print

the sum when the function returns.

Example:

Python Write a function called sumTo that takes as arguments two numbers.

CWINDOWSlsystem32 cmd.exe Enter Two Numbers 2 The sum of the numbers is 35 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!