想知道print(my_sumB(5))=15这个结果是怎么算出来的
# 递归 def my_sumB(n): sum = 0 if n == 1: sum = n else: sum = n + my_sumB(n - 1) return sum
print(my_sumB(5))
# 递归 def my_sumB(n): sum = 0 if n == 1: sum = n else: sum = n + my_sumB(n - 1) return sum
print(my_sumB(5))
2021-02-06
举报