Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list to arguments

a = [1, 2]
def add(x,y):
  return x + y

add(*a) # this is the same as add(a[0],a[1])
# returns 3
 
PREVIOUS NEXT
Tagged: #python #list #arguments
ADD COMMENT
Topic
Name
6+9 =