Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

unlimited arguments python

def add(*args):		# *args takes multiple inputs
  return sum(args)


print(add(1,2,3,4,5))    # prints 15
print(add(10, 20, 30))	 # prints 60
 
PREVIOUS NEXT
Tagged: #unlimited #arguments #python
ADD COMMENT
Topic
Name
3+2 =