利用python递归,计算1~100的和
def sum_num(num): if num <=1: return 1 return num + sum_num(num - 1) print(sum_num(100))