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
python - Pass list elements as arguments of a function one by one - Stack Overflow
Suppose I have a function to calculate the square of a certain number. Now, I have a list of, for example, 100 numbers that I need to pass as the arguments. How do I pass each element of the list, ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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'])
🌐
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.
Find elsewhere
🌐
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.
🌐
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:...
🌐
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:
🌐
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.
🌐
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
March 3, 2026 - 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.
🌐
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.
🌐
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
🌐
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
🌐
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 26, 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 ·
🌐
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 ...