liveBook · Manning

Function argument

A function argument is a value or expression supplied when a function or method is invoked, providing input to the called operation.

How 5 Manning books explain it

A Pythonic Adventure: From Python basics to a working web app

A function argument is a value supplied to a function call for the function to operate on.

How it is used
Uses arguments to give print(), input(), and reusable menu functions the information they need.
How deep it goes
Explains passing strings, numbers, and variables through calls, then works through a three-argument menu function with defaults.
Examples
Demonstrates print and input prompts, then a coffee-shop menu selecting drinks, flavors, and toppings.
What you can do after
Build it from scratch by writing and calling a menu function that accepts choices, titles, and prompts.

Read how A Pythonic Adventure: From Python basics to a working web app explains function argument →

The Well-Grounded Rubyist, Fourth Edition

A Ruby argument is a value supplied to a method call and is distinct from a supplied block.

How it is used
Uses arguments to supply objects to Ruby method calls, including conversions, array operations, and proc calls.
How deep it goes
Defines arguments against formal parameters, works through required and optional counts, and explains object references; leaves lambda argument rules undeveloped.
Examples
Illustrates arguments with Celsius conversion, wrong-count errors, rest arrays, default values, string mutation, and proc calls.
What you can do after
Build it from scratch by defining method parameters, supplying matching arguments, and choosing rest or default parameters when calls vary.

Read how The Well-Grounded Rubyist, Fourth Edition explains function argument →

Python Workout, Second Edition

A function argument is a value supplied to a function call for use by the corresponding parameter.

How it is used
Uses arguments to pass fixed, optional, variable-length, or named values into Python functions.
How deep it goes
Explains defaults, tuple collection, iterable unpacking, and dictionary-based keyword processing, stopping short of deeper call mechanics.
Examples
Uses a variable-argument summation function and an XML-tag function with optional content and keyword-generated attributes.
What you can do after
Apply it via Python function calls that pass optional values, unpack iterables, or supply arbitrary keyword pairs.

Read how Python Workout, Second Edition explains function argument →

Statistics Slam Dunk

A function argument is an input value supplied to a function when it is invoked.

How it is used
Uses supplied input values to control what a function does when it runs.
How deep it goes
Defines arguments, distinguishes them from function bodies and return values, and demonstrates a missing-argument error.
Examples
Uses pivot_wider(), r_to_rsquared(), and gini.est() calls to show supplied inputs, outputs, and missing arguments.
What you can do after
Apply R functions by supplying required inputs and interpreting their returned values.

Read how Statistics Slam Dunk explains function argument →

The Well-Grounded Python Developer: How the pros use Python and Flask

An argument is a value supplied to a function or method when it is called.

How it is used
Uses arguments to pass information from calling code into functions and methods through an API contract.
How deep it goes
Defines arguments and parameters, then demonstrates positional, keyword, variadic, and default arguments through print.
Examples
Uses print calls with one or multiple strings and examines the print signature’s sep, end, file, and flush parameters.
What you can do after
Apply it via Python function calls to pass values positionally or by keyword and customize print output.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains function argument →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.