赞
踩
def SUM(x,y): sum=0 for i in range(x,y+1): sum+=i print(sum) return sum a=eval(input('请输入起始数值:')) b=eval(input('请输入终止数值:')) SUM(a,b)
运行效果: