def func(a, b): s = 0 for i in range(a, b+1): s += i return s print(func(1, 5))
如果对你有帮助,可以点击我这个回答右上方的【采纳】按钮,给我个采纳吗,谢谢