def sum(alist):
? ? first,*other=alist
? ? return first+sum(other) if other else first
print ( sum(range(1,101)) )
'''
輸出:5050
'''
def sum(alist):
? ? first,*other=alist
? ? return first+sum(other) if other else first
print ( sum(range(1,101)) )
'''
輸出:5050
'''