Loading... def sum(a): if a == []: return 0 #基线条件 return a[0] + sum(a[1:]) #递归条件 print(sum(a)) Last modification:March 31, 2021 © Allow specification reprint Like 0 如果觉得我的文章对你有用,请随意赞赏
Comment here is closed