You can pass multiple arguments to a function via the star sytax like *numbers
.
The function that can handle many numbers is shown below.
def multiply(*numbers):
result = 1
for n in numbers:
result = result * n
return result
args kwargs: numbers
You can pass multiple arguments to a function via the star sytax like *numbers
.
The function that can handle many numbers is shown below.
def multiply(*numbers):
result = 1
for n in numbers:
result = result * n
return result