Created
September 16, 2020 07:46
-
-
Save River2056/a8180c94e7741112833ff11df61bba76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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