When you define your function using this syntax:

def someFunc(*args):
    for x in args
        print x

You're telling it that you expect a variable number of arguments. If you want to pass in a List (Array from other languages) you'd do something like this:

def someFunc(myList = [], *args):
    for x in myList:
        print x

Then you can call it with this:

items = [1,2,3,4,5]

someFunc(items)

You need to define named arguments before variable arguments, and variable arguments before keyword arguments. You can also have this:

def someFunc(arg1, arg2, arg3, *args, **kwargs):
    for x in args
        print x

Which requires at least three arguments, and supports variable numbers of other arguments and keyword arguments.

Answer from g.d.d.c on Stack Overflow
🌐
W3Schools
w3schools.com › python › gloss_python_function_passing_list.asp
Python Passing a List as an Argument
E.g. if you send a List as an argument, it will still be a List when it reaches the function: def my_function(food): for x in food: print(x) fruits = ["apple", "banana", "cherry"] my_function(fruits) Try it Yourself » · Python Functions Tutorial Function Call a Function Function Arguments *args Keyword Arguments **kwargs Default Parameter Value Function Return Value The pass Statement i Functions Function Recursion
🌐
Note.nkmk.me
note.nkmk.me › home › python
Expand and Pass a List and Dictionary As Arguments in Python | note.nkmk.me
August 19, 2023 - In Python, you can expand a list, tuple, and dictionary (dict) and pass their elements as arguments by prefixing a list or tuple with an asterisk (*), and prefixing a dictionary with two asterisks (**) when calling functions.
Discussions

passing a list as function arguments
def fx(a,b): return a * b f = {'a': 2, 'b': 3} print(fx(**f)) More on reddit.com
🌐 r/learnpython
7
2
May 13, 2021
python - How to pass list elements as arguments - Stack Overflow
1 how to iterate through each element of a unknown length of list while passed as argument to a function in python? More on stackoverflow.com
🌐 stackoverflow.com
December 6, 2014
python - Converting list to *args when calling function - Stack Overflow
Elements from this iterable are treated as if they were additional positional arguments; if there are positional arguments x1, ..., xN, and expression evaluates to a sequence y1, ..., yM, this is equivalent to a call with M+N positional arguments x1, ..., xN, y1, ..., yM. This is also covered in the python ... More on stackoverflow.com
🌐 stackoverflow.com
When to use *args and when to take a list as argument?
It's all semantics, really. Pick whichever feels more natural to use. If it's a function where you feel you would naturally be giving an iterable (not necessarily just a list) as an argument, such as a maze, do that. And if you feel using it would be closer to how you'd use print, for example, varargs may be a better fit. You don't even have to choose. max and min technically do both; if you only give them one argument, they assume it's a data structure, and if multiple they'll be treated like varargs. More on reddit.com
🌐 r/learnpython
5
5
August 11, 2024
🌐
GeeksforGeeks
geeksforgeeks.org › python › pass-a-list-to-a-function-in-python
Pass a List to a Function in Python - GeeksforGeeks
July 23, 2025 - This function prints each element of the list l. list l is passed, printing the numbers one by one. This allows us to pass a list to a function and unpack it into separate arguments.
🌐
LabEx
labex.io › tutorials › python-how-to-pass-list-as-argument-in-python-421192
How to pass list as argument in Python | LabEx
By mastering list arguments, you'll enhance your Python programming skills in LabEx environments, creating more flexible and powerful functions. ## Append: Add to end of list fruits = ['apple', 'banana'] fruits.append('cherry') ## Insert: Add at specific position fruits.insert(1, 'blueberry') ## Extend: Add multiple elements fruits.extend(['date', 'elderberry'])
🌐
Quora
quora.com › How-do-you-pass-a-list-of-values-to-a-function-in-Python-3-x
How to pass a list of values to a function in Python 3.x - Quora
I will suggest you a few methods to o pass a list as a parameter in python function, at the end I will also show you how to creatively use tuple as a parameter · Let following be our function that requires a list as a parameter ... Technically there could be a lot of ways to do the same thing might above examples helped you. Now let us see if you want undefinate no. Of parameters as a tuple in a function. ... As you can see we can pass any number of positional arguments to the function and extract them as a list in function's local environment.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-passing-list-as-an-argumnet
Python - Passing list as an argumnet - GeeksforGeeks
July 23, 2025 - : ... def nested_list(nested_list): ... [3, 4], [5, 6]] nested_list(a) ... We can use the *args syntax to unpack the elements of a list and pass them as separate arguments to a function:...
🌐
Toppr
toppr.com › guides › computer-science › programming-with-python › lists › lists-as-arguments
Python Passing a Lists as Arguments: Definition and Concepts
May 25, 2021 - In Python, we can easily expand the list, tuple, dictionary as well as we can pass each element to the function as arguments by the addition of * to list or tuple and ** to dictionary while calling function.
🌐
Runestone Academy
runestone.academy › ns › books › published › py4e-int › lists › listAsArgument.html
9.13. List arguments — Python for Everybody - Interactive
When you pass a list to a function, the function gets a reference to the list. If the function modifies a list parameter, the caller sees the change. For example, delete_head removes the first element from a list and is used like this:
🌐
Replit
replit.com › home › discover › how to pass a list as an argument in python
How to pass a list as an argument in Python | Replit
1 month ago - When you call calculate_average(*values), Python takes each element from the values list and passes it as a separate positional argument to the function.
🌐
Delft Stack
delftstack.com › home › howto › python › python pass list to function
How to Pass List to Function in Python | Delft Stack
February 2, 2024 - In Python, you can pass the elements of a list as multiple arguments to a function using the asterisk (*) operator. This technique is known as unpacking, and it allows you to pass each element of the list as an individual argument to the function.
🌐
YouTube
youtube.com › studysession
Passing Lists To Functions In Python - YouTube
Passing a list to a function in Python is very similar to passing a singular argument to a python function. In this video we pass two lists to a python funct...
Published   January 8, 2021
Views   20K
🌐
GeeksforGeeks
geeksforgeeks.org › pass-list-as-command-line-argument-in-python
Pass list as command line argument in Python - GeeksforGeeks
January 30, 2020 - We can directly pass a list as a function argument.Pyt ... Command line arguments are those values that are passed during the calling of the program along with the calling statement. Usually, python uses sys.argv array to deal with such arguments but here we describe how it can be made more resourceful and user-friendly by employing argparse module.
🌐
jdhao's digital space
jdhao.github.io › 2022 › 07 › 27 › pass_list_by_value_python
How to Pass List by Value as Parameter in Python · jdhao's digital space
July 27, 2022 - If the list element is a mutable type themselves, they will not work. Only the copy.deepcopy() method can truly create a new list. https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x · clone a list so that it doesn’t change after assignment: https://stackoverflow.com/q/2612802/6064933 · pass list as argument: https://stackoverflow.com/q/2322068/6064933 ·
🌐
Sling Academy
slingacademy.com › article › python-passing-a-list-to-a-function-as-multiple-arguments
Python: Passing a List to a Function as Multiple Arguments - Sling Academy
def process_data(*args, **kwargs): # Process individual arguments for arg in args: print("Processing argument:", arg) # Process keyword arguments for key, value in kwargs.items(): print("Processing keyword argument:", key, "=", value) # Create a list and dictionary my_list = [1, 2, 3] my_dict = {"name": "Frienzied Flame", "age": 1000} # Pass the list and dictionary as multiple arguments to the function process_data(*my_list, **my_dict) ... Processing argument: 1 Processing argument: 2 Processing argument: 3 Processing keyword argument: name = Frienzied Flame Processing keyword argument: age = 1000 · That’s it. Happy coding! Next Article: Python: Generate a Dummy List with N Random Elements
🌐
KodeKloud Notes
notes.kodekloud.com › docs › Python-Basics › Functions › List-as-Argument › page
List as Argument - KodeKloud
In this article, we explore how to pass lists as arguments to Python functions, enhancing flexibility beyond just handling strings and numbers. We will demonstrate this concept by creating a function named multiply_values that accepts a list and returns a new list with each element multiplied by 2.
🌐
Studytonight
studytonight.com › python-howtos › pass-a-list-to-a-function-to-act-as-multiple-arguments
Pass a List to a Function to act as Multiple Arguments - Studytonight
February 16, 2021 - This concept of passing a single list of elements as multiple arguments is known as Unpacking Argument List. We use *args to unpack the single argument into multiple arguments. We use the unpacking operator * when arguments are not available ...