Section 34.1: Function and Call
Lists as arguments are just another variable:
def func(myList):
for item in myList:
print(item)
and can be passed in the function call itself:
func([1,2,3,5,7])
1
2
3
5
7
Or as a variable:
aList = ['a','b','c','d']
func(aList)
a
b
c
d
Must Read Python Interview Questions
200+ Python Tutorials With Coding Examples
Other Python Tutorials
- What is Python?
- Python Advantages
- Python For Beginners
- Python For Machine Learning
- Machine Learning For Beginners
- 130+ Python Projects With Source Code On GitHub