Question: This code should prompt the code for two integers a and b, and computes the sum of all integers greater than or equal to a

This code should prompt the code for two integers a and b, and computes the sum of all integers greater than or equal to a and less than or equal to b. If a is not less than b, your program should print out an error message

$ python3 sumRange.py Enter an integer for the lower limit: 1 Enter an integer for the upper limit: 10 The sum from 1 to 10 is 55 $ python3 sumRange.py Enter an integer for the lower limit: 10 Enter an integer for the upper limit: 100 The sum from 10 to 100 is 5005 $ python3 sumRange.py Enter an integer for the lower limit: -10 Enter an integer for the upper limit: 3 The sum from -10 to 3 is -49 $ python3 sumRange.py Enter an integer for the lower limit: 10 Enter an integer for the upper limit: 4 Error: 10 > 4 

please add comments explaining! Thank you!

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!