Untitled
unknown
plain_text
2 years ago
300 B
6
Indexable
def sum_of_arguments(*args):
# initialize the sum to 0
total = 0
# add up all of the arguments
for arg in args:
total += arg
# return the sum
return total
# call the function to calculate the sum of several numbers
print(sum_of_arguments(1, 2, 3, 4, 5))Editor is loading...
Leave a Comment