Open this example in the interactive library
Source code
def total(*values):
return sum(values)
print(total(2, 3, 5))Sample output
10

Accept arbitrary arguments. A self-contained example using the Python standard library.
Open this example in the interactive library
def total(*values):
return sum(values)
print(total(2, 3, 5))10