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
๐ŸŒ
Stanford CS
cs.stanford.edu โ€บ people โ€บ nick โ€บ py โ€บ python-main.html
Python main() - Command Line Arguments
$ python3 affirm.py -affirm Lisa Everything is coming up Lisa $ python3 affirm.py -affirm Bart Looking good Bart $ python3 affirm.py -affirm Maggie Today is the day for Maggie $ Command line arguments, or "args", are extra information typed on the line when a program is run.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ tutorial โ€บ controlflow.html
4. More Control Flow Tools โ€” Python 3.14.3 documentation
The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference, not the value ...
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_arguments.asp
Python Function Arguments
Python Examples Python Compiler ... Q&A Python Bootcamp Python Certificate Python Training ... Information can be passed into functions as arguments....
๐ŸŒ
Medium
moez-62905.medium.com โ€บ the-ultimate-guide-to-command-line-arguments-in-python-scripts-61c49c90e0b3
The Ultimate Guide to Command Line Arguments in Python Scripts | by Moez Ali | Medium
April 18, 2023 - Command line arguments are a powerful way to pass parameters to a program when it is executed. They allow users to customize the behavior of the program without modifying its source code. Command-line arguments are used extensively in the Unix/Linux command-line interface and are also commonly used in scripting languages like Python.
๐ŸŒ
Built In
builtin.com โ€บ software-engineering-perspectives โ€บ arguments-in-python
5 Types of Python Function Arguments | Built In
Learn about the five different types of arguments used in python function definitions: default, keyword, positional, arbitrary positional and arbitrary keyword arguments.
Find elsewhere
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ python_command_line_arguments.htm
Python - Command-Line Arguments
Python Command Line Arguments provides a convenient way to accept some information at the command line while running the program. We usually pass these values along with the name of the Python script.
๐ŸŒ
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
๐ŸŒ
Pimoroni
learn.pimoroni.com โ€บ python-arguments
Python Arguments
May 12, 2014 - We're going to have to provide a value for regular_arg to make sure our positional arguments are in the right positions... or are we? >>> my_function(1,unimportant_arg=True) (1, 'Some Value', True, 3.14) Whew! That's handy. Python is clever enough to figure out that we're trying to supply a value for unimportant_arg even though it's just a positional argument with a default value.
๐ŸŒ
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โ€ฆ
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ argparse.html
argparse โ€” Parser for command-line options, arguments and subcommands
Refer to Choosing an argument parsing ... positional arguments, or accepting option parameter values that start with - even when they correspond to another defined option). ... This page contains the API reference information. For a more gentle introduction to Python command-line ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ args-kwargs-python
*args and **kwargs in Python - GeeksforGeeks
In Python, *args and **kwargs are used to allow functions to accept an arbitrary number of arguments.
Published ย  September 20, 2025
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ os.html
os โ€” Miscellaneous operating system interfaces
1 month ago - If the function also supports dir_fd or follow_symlinks arguments, itโ€™s an error to specify one of those when supplying path as a file descriptor. paths relative to directory descriptors: If dir_fd is not None, it should be a file descriptor referring to a directory, and the path to operate on should be relative; path will then be relative to that directory. If the path is absolute, dir_fd is ignored. For POSIX systems, Python will call the variant of the function with an at suffix and possibly prefixed with f (e.g.
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ args-and-kwargs
Python *args and **kwargs (With Examples)
As in the above example we are not sure about the number of arguments that can be passed to a function. Python has *args which allow us to pass the variable number of non keyword arguments to function.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_args_kwargs.asp
Python *args and **kwargs
Arbitrary Arguments are often shortened to *args in Python documentation.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ typing.html
typing โ€” Support for type hints
1 month ago - The Python runtime does not enforce function and variable type annotations. They can be used by third party tools such as type checkers, IDEs, linters, etc. This module provides runtime support for type hints. ... def surface_area_of_cube(edge_length: float) -> str: return f"The surface area of the cube is {6 * edge_length ** 2}." The function surface_area_of_cube takes an argument expected to be an instance of float, as indicated by the type hint edge_length: float.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ functions.html
Built-in Functions โ€” Python 3.14.3 documentation
1 month ago - The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order. ... Return the absolute value of a number. The argument may be an integer, a floating-point number, or an object implementing __abs__().
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ difference between arguments and parameters
r/Python on Reddit: Difference between Arguments and Parameters
January 15, 2016 -

Hi guys, myself and a colleague have had some issues figuring out the differences between Arguments and Parameters. Coming from a highschool-IT background I was always told that the term is "Parameter passing". My colleague has always been taught "Argument passing" and we can't quite figure out amongst ourselves if one of us has an incorrect understanding.

ie:

def Calculate(x,y) #I believe the () items are *parameters*
    z = x + y
    return z

Calculate(5,6) # I believe the () elements are *Arguments*
    *returns 11*

A few resources online have outlined the difference between Arguments and Parameters as:

Arguments: The actual value passed, ie. Calculate(5,3). Actual Arguments

Parameters: The placeholders ie. Calculate(x,y). Formal Parameters

Others have designated parameters and Arguments as interchangeable terms. My experience with a tutorial (LPTHW, my bad!) are that arguments are passed on a program-by-program basis and that parameters are passing in-program.

ie. $ python MyScript.py arg1 arg2 arg3

If someone could end this dilemma or provide tutorials outlining the difference, I would be very grateful!

๐ŸŒ
Codecademy
codecademy.com โ€บ article โ€บ command-line-arguments-in-python
Command Line Arguments in Python (sys.argv, argparse) | Codecademy
Python Command line arguments are parameters passed to a script when itโ€™s executed from the command line interface. These arguments allow users to customize how a Python program runs without modifying the source code.
๐ŸŒ
Medium
medium.com โ€บ @evaGachirwa โ€บ running-python-script-with-arguments-in-the-command-line-93dfa5f10eff
Running Python script with Arguments in the command line | by Eva Mwangi | Medium
April 22, 2023 - The sys module provides functions and variables to manipulate Pythonโ€™s runtime environment. Through sys.argv arguments are passed from the command line to the Python script.