Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to insert an array as a parameter in python

def dosomething( thelist ):
    for element in thelist:
        print element

dosomething( ['1','2','3'] )
alist = ['red','green','blue']
dosomething( alist )

Produces the output:

1
2
3
red
green
blue
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #insert #array #parameter #python
ADD COMMENT
Topic
Name
8+3 =