Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def sum(*agrs):
result = 0
for nums in agrs:
result += nums
return result
print(sum(1, 2, 3, 4, 5)) # 輸出15
print(sum(2, 4)) # 輸出6
print(sum(5, 6, 7, 8, 9, 10)) # 輸出45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.