Python tutorial explains it:

import sys

print(sys.argv)

More specifically, if you run python example.py one two three:

>>> import sys
>>> print(sys.argv)
['example.py', 'one', 'two', 'three']
Answer from SilentGhost on Stack Overflow
🌐
Python Course
python-course.eu › python-tutorial › passing-arguments.php
25. Passing Arguments | Python Tutorial | python-course.eu
November 8, 2023 - By using these parameters, it's possible to use all kind of objects from "outside" inside of a function. The syntax for how parameters are declared and the semantics for how the arguments are passed to the parameters of the function or procedure depends on the programming language.
🌐
Python.org
discuss.python.org › python help
Passing argument to function from command line - Python Help - Discussions on Python.org
June 25, 2025 - My son wrote a command line program in ruby for me. I want to convert it to python. To run the program he has done this on the command line; “./myProgram.rb ‘argument’”. Then the 'argument ’ is passed into the progra…
Discussions

Best way to pass arguments to a function that requires a large number of inputs?
For me it sounds like an insane amount of arguments for just one function and is in need of refractoring. More on reddit.com
🌐 r/learnpython
38
24
November 4, 2023
python - How do I access command line arguments? - Stack Overflow
where i is index, 0 will give you the python filename being executed. Any index after that are the arguments passed. More on stackoverflow.com
🌐 stackoverflow.com
Some way to get arguments of current function for passing along to another function even when not using *args/**kw
Often times I have a function that does not make use of *args/**kw for various reasons but still needs to pass along all arguments to another function. An example would be: def other_fun(a, b, c=7, d=9): ... def … More on discuss.python.org
🌐 discuss.python.org
9
1
June 10, 2024
How to pass through Python args and kwargs? - Stack Overflow
I realize I could parse them in save_name and then pass them explicitly to save_name_for but that seems rather inelegant. I also thought I might do this since args is a tuple... ... ... but it doesn't appear to work. args[2] is just everything (I don't understand this). Is there a Pythonic way to do this? ... See also Expanding tuples into arguments ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › python › deep-dive-into-parameters-and-arguments-in-python
Python Function Parameters and Arguments - GeeksforGeeks
This article focuses to clarify ... within the parentheses when we declare a function. ... An argument is a value that is passed to a function when it is called....
Published: July 23, 2025
🌐
W3Schools
w3schools.com › python › python_arguments.asp
Python Function Arguments
Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma. The following example has a function with one argument (fname).
🌐
GeeksforGeeks
geeksforgeeks.org › python › passing-function-as-an-argument-in-python
Passing Function as an Argument in Python - GeeksforGeeks
June 5, 2026 - A higher-order function is a function that takes another function as an argument or returns a function. It helps write reusable and cleaner code. Example 1: In this example, the double() function is passed to another function to double a number. Python · def fun(func, number): return func(number) def double(x): return x * 2 print(fun(double, 5)) Output ·
🌐
Reddit
reddit.com › r/learnpython › best way to pass arguments to a function that requires a large number of inputs?
r/learnpython on Reddit: Best way to pass arguments to a function that requires a large number of inputs?
November 4, 2023 -

For example, suppose I had a function which required 50 arguments and these arguments were stored in an object with 500 properties.

I could simply pass the object to the function, but then I’d be passing an addition 450 values that are not needed by the function. This feels like bad practice, but I’m not aware of whether or not that’s true.

EDIT: 50 args does indeed sound excessive (and I’ll admit that it’s a slight exaggeration). However, quite a lot of arguments are taken by this function because it is responsible for aggregating results from other models. In addition to taking in lots of inputs, there are also various aggregation settings that the user may specify.

🌐
Medium
medium.com › informatics › a-guide-to-passing-arguments-in-python-functions-811abcf96533
A Guide to Passing Arguments in Python Functions | by M. Ramadhan | Informatics | Medium
October 22, 2024 - Sharing facts, thoughts, experiences, and ideas related to informatics. I also write at https://emramadhan.com. You can support my work at https://ko-fi.com/emramadhan to fuel my next article. Thank you! ... M. Ramadhan ... What is a Function? ▹ Key Features of a Function ▹ Function Structure Parameters vs Arguments ▹ Parameters ▹ Arguments Passing Arguments ▹ Positional Arguments ▹ Keyword Arguments Default Parameters ▹ How Default Parameters Work ▹ Calling the Function With and Without Default Parameter ▹ Important Points about Default Parameters ▹ Multiple Default Parameters ▹ Advantages of Default Parameters The local and global Scope ▹ 1.
Find elsewhere
🌐
Educative
educative.io › answers › how-to-pass-a-parameter-to-a-function-in-python
How to pass a parameter to a function in Python
The double line breaks must be included after defining a function. (Theophilus) and (Chidalu) are the arguments passed to the greet_customer(name) function whenever it is called.
🌐
Trey Hunner
treyhunner.com › 2020 › 01 › passing-functions-as-arguments
Passing a function as an argument to another function in Python
January 14, 2020 - This function expects the predicate argument to be a function (technically it could be any callable). When we call that function (with predicate(item)), we pass a single argument to it and then check the truthiness of its return value. A lambda expression is a special syntax in Python for creating an anonymous function.
🌐
BimStudies
bimstudies.com › home › docs › functions › programming with python
Passing Arguments to Functions – BimStudies.Com
May 2, 2025 - Arguments are matched to parameters in the order they are given. def add(a, b): return a + b print(add(5, 3)) # Output: 8 ... Arguments are passed using parameter names.
🌐
Real Python
realpython.com › python-pass-by-reference
Pass by Reference in Python: Background and Best Practices – Real Python
March 18, 2026 - As you can see, the refParameter of squareRef() must be declared with the ref keyword, and you must also use the keyword when calling the function. Then the argument will be passed in by reference and can be modified in place. Python has no ref keyword or anything equivalent to it.
🌐
GeeksforGeeks
geeksforgeeks.org › python › command-line-arguments-in-python
Command Line Arguments in Python - GeeksforGeeks
In Python, command line arguments are values passed to a script when running it from the terminal or command prompt.
Published: December 17, 2025
🌐
Python Morsels
pythonmorsels.com › passing-functions-arguments-other-functions
Passing functions as arguments to other functions - Python Morsels
June 3, 2021 - This get_two function accepts a function as an argument: >>> def get_two(func, thing): ... return func(thing), func(thing) ... The one thing that you can do with every function is call it. So this get_two function is assuming that func points to a function object or some other callable object (anything that you can call by putting parentheses after it). In Python you can pass function objects in to other functions.
🌐
Python.org
discuss.python.org › python help
Some way to get arguments of current function for passing along to another function even when not using *args/**kw - Python Help - Discussions on Python.org
June 10, 2024 - Often times I have a function that does not make use of *args/**kw for various reasons but still needs to pass along all arguments to another function. An example would be: def other_fun(a, b, c=7, d=9): ... def myfun(a, b, c=7, d=9): v = other_fun(a, b, c=c, d=d) # do some other post processing of v, often times depending on the input arguments ...
🌐
Towards Data Science
towardsdatascience.com › home › data science › python args, kwargs, and all other ways to pass arguments to your function
Python args, kwargs, and All Other Ways to Pass Arguments to Your Function | Towards Data Science
March 7, 2023 - The value world is passed with a keyword; we specify that we want to pass world to the thing parameter. ... The difference between positional arguments and kwargs (keyword arguments) is that the order in which you pass positional arguments matter.
🌐
AskPython
askpython.com › python › examples › pass-function-as-argument
Python: How to pass a function as an argument? - AskPython
July 11, 2021 - Like user-defined and lambda functions we can also pass an operator function as an argument to another function. Here we will be using operator.mul() function from the operator module and pass it to the reduce() function which is defined in the functools module along with a Python list.
🌐
Analytics Vidhya
analyticsvidhya.com › home › 3 easy ways to handle command line arguments in python
3 Easy Ways to Handle Command Line Arguments in Python
January 15, 2025 - The simplest way to handle command line arguments is by using the sys module’s argv. The argv is a list in Python, which contains the command-line-arguments pass argument to python script.
🌐
Alma Better
almabetter.com › bytes › tutorials › python › arguments-in-python-functions
Arguments in Python Functions
April 19, 2024 - Function arguments are values passed to a function when it is called. On the other hand, parameters are the variables inside the function's parentheses. There are four types of function arguments in Python: required arguments, default arguments, ...