Write A Python Program Using A Function Called Sum_range That Accepts Two Integer Numbers, A, And B (assume That B > A), Entered By The User And Returns The Sum Of Numbers From A To B. For Example, If A = 5 And B = 10, Then The Function Returns 45 (tha

匿名用户 最后更新于 2021-11-29 17:10 计算机类Computing

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

已邀请: