Argument

The actual value you pass to a function when you call it.

An argument is the real value handed to a function at call time, filling one of its parameters. You can pass arguments positionally (by order) or as keyword arguments (by name), which is clearer when there are several.

Example
def make_user(name, admin=False):
    return {"name": name, "admin": admin}

print(make_user("Ada"))                # positional
print(make_user("Bo", admin=True))     # keyword argument
Output
{'name': 'Ada', 'admin': False}
{'name': 'Bo', 'admin': True}

Where this shows up in real Python

Arguments feed data into every function call — a filename to open, a URL to fetch, options for a command-line tool.

Commonly used Argument tools

  • f(1, 2) — positional arguments, matched by order
  • f(name='Sam') — keyword argument, matched by name
  • f(*my_list) — unpack a list into positional arguments
  • f(**my_dict) — unpack a dict into keyword arguments

Official documentation: Python Glossary: argument

Related lessons