Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Python :: 1051 texes uri solution 
Python :: fill missing values with meadian in df 
Python :: Run multiple functions at the same time 
Python :: if ele in python 
Python :: make setup file for cython 
Python :: python groupby 1d array 
Python :: python program to remove comment lines 
Python :: 198727191002 
Python :: checking if something is true. infinite 
Python :: how to connect smartphone camera to opencv python 
Python :: python copy list from index 
Python :: heapq basic push and pop - default minHeap 
Python :: Collections module: deques and queues 
Python :: how to remove hidden white spaces n columns 
Python :: calculate iou of two rectangles 
Python :: design patterns python - restrict what methods of the wrapped class to expose 
Python :: keep 0 in front of number pandas read csv 
Python :: print hi in python 
Python :: python Pandas - Analyzing DataFrames 
Python :: python c api 
Python :: python how to not allow class instance 
Python :: qr code scanner on django 
Python :: manim replacement transform 
Python :: python check anangram 
Python :: quicksort python3 
Python :: problem 1 dot product python 
Python :: 56.5 to 57 in python 
Python :: star rating form in flask 
Python :: how to find left top width and height on an image using python 
Python :: how to sum a column in csv python using list in python 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =