How to Pass a List As an Argument in Python


In this example, we will learn how to pass a List as an Argument in Python.

Source Code

def my_function(letter):
    for x in letter:
        print(x)

letter = ['a', 'b', 'c']

my_function(letter)

Output:

a
b
c
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement