Write a Python program using a function calledsum_range that accepts two integer numbers,a, and b (assume that b > a),entered by the user and returns the sum of numbers froma to b. For example, if a = 5 andb = 10, then the function returns 45 (that is 5 + 6 + 7 + 8 + 9 +10 = 45). Use for loop to calculate the sum in thefunction. Assume that the user does enter invalid inputs.
===================================
Sample Run:
Enter number 1: 5
Enter number 2: 10
Sum of numbers from 5 to 10 =45
没有找到相关结果