Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
300 B
1
Indexable
Never
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))
Leave a Comment