Return value
A return value is the result produced by a function, method, or operation and supplied to the code that invoked it.
Python How-To
The value produced by a function call, either explicitly by a return statement or implicitly when execution reaches the end of the function.
- How it is used
- Guides the design and use of function outputs in user-friendly Python functions.
- How deep it goes
- Explains implicit and explicit returns, assignment, multiple-value returns, and practical return-count guidance.
- Examples
- Uses sum, in-place list sorting, a greeting function, and a statistics function to illustrate results.
- What you can do after
- Apply return values in Python by assigning or unpacking results and avoiding chains on methods that return None.
The Well-Grounded Rubyist, Fourth Edition
A return value is the value produced by evaluating a Ruby method call, implicitly taken from the method's last evaluated expression unless execution returns earlier.
- How it is used
- Connects method calls to expression values, object queries, and the results of iteration.
- How deep it goes
- Explains implicit and explicit returns, early exit, empty methods, multiple values, and the distinction between block results and method results.
- Examples
- Uses temperature conversion, ticket queries, irb iteration output, and a hand-built map accumulator.
- What you can do after
- Build it from scratch: implement a map-like method that collects block results and returns the resulting array.
Read how The Well-Grounded Rubyist, Fourth Edition explains return value →
Learn AI-Assisted Python Programming, Second Edition
A return value is the result that a function sends back to the code that called it.
- How it is used
- Uses returned results to connect function calls, later computation, and testing.
- How deep it goes
- Explains calls, arguments, assignment, and test categories, but stops short of implementation internals.
- Examples
- Shows larger, money_made, max, input, and password-validation functions returning values.
- What you can do after
- Apply it via Python by capturing function results, inspecting outputs, and testing varied inputs.
Read how Learn AI-Assisted Python Programming, Second Edition explains return value →
The Art of Unit Testing 3e
A return value is data produced by a function and delivered to its caller when the function completes.
- How it is used
- Treats a useful function return as a publicly observable exit point for a unit test.
- How deep it goes
- Defines useful returns and contrasts them with other exit points, without exploring language-level return mechanics.
- Examples
- Shows a sum function returning a result and a password verifier returning a boolean.
- What you can do after
- Apply it through value-based tests that check public results instead of mocking protected helper calls.
The Quick Python Book, Fourth Edition
A return value is the result supplied by a function to its caller when the function completes execution.
- How it is used
- Uses returned results to pass computed data from functions to calling code and support refactoring into reusable functions.
- How deep it goes
- Explains explicit and implicit returns, early termination, discarded results, assignment, and name-collision failure, without covering implementation internals.
- Examples
- Demonstrates factorial computation, displayed versus assigned results, and text-cleaning functions used in a word-processing pipeline.
- What you can do after
- Apply it via Python functions to capture results, discard them deliberately, return early, and avoid callable-name collisions.
Read how The Quick Python Book, Fourth Edition explains return value →
The Well-Grounded Python Developer: How the pros use Python and Flask
A function return value is the object supplied by a function to the caller when the function completes.
- How it is used
- Defines function output as reusable data within API contracts and application-level function orchestration.
- How deep it goes
- Explains scalar results, compound tuples, implicit None, status flags, unpacking, reuse, and testability.
- Examples
- Uses abs, split_fullname tuple unpacking, and a full_name refactoring from printing to returning.
- What you can do after
- Apply it by returning reusable data, unpacking compound results, reporting operation status, and testing outputs directly.
Grokking Simplicity
The value produced as the result of a function invocation.
- How it is used
- Separates calculations from actions so callers can reuse results in the DOM, accounting, shipping, or further calculations.
- How deep it goes
- Defines explicit outputs, contrasts synchronous returns with asynchronous callbacks, and stops short of broader asynchronous abstractions.
- Examples
- Uses shopping-cart totals, DOM updates, shipping calculations, accounting reuse, and a synchronous-versus-asynchronous pet-count example.
- What you can do after
- Apply it to extract calculations, return reusable results, and replace asynchronous returns with callbacks.
Statistics Slam Dunk
A return value is the output produced by a function after it runs.
- How it is used
- Uses return values to explain how built-in and user-defined R functions produce usable analytical outputs.
- How deep it goes
- Defines return values and demonstrates explicit returns in custom functions, without descending into evaluation internals.
- Examples
- Demonstrates mean(), correlation conversion, and a Gini estimate with numeric outputs and a missing-argument error.
- What you can do after
- Build it from scratch by writing R functions that calculate, return, and reuse derived values.
Also covered in
- 100 Java Mistakes and How to Avoid Them
- The Art of Code
- Elixir in Action, Third Edition
- Get Programming: Learn to code with Python
- Practices of the Python Pro
- Software Design for Python Programmers
- Regular Expression Puzzles and AI Coding Assistants
- Snowflake Data Engineering
- Pro Angular 16
- Data-Oriented Programming: Reduce software complexity
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- callA call is an invocation that requests execution of a function, routine, command, or tool, optionally supplying arguments.
- classA class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
- asynchronous programmingAsynchronous programming structures operations so that the initiating execution can continue or yield control without synchronously waiting for each operation to complete.
Related concepts
- expressionproduced by · An expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result.
- last expressionproduced by · The last expression is the final expression evaluated in a Ruby method body, whose value becomes the method's implicit return value unless an explicit return intervenes.
- method callproduced by · A method call is an expression that invokes a method associated with an object, value, or type, optionally supplying arguments.
- return statementconfigured by · A return statement ends the current function or routine invocation and optionally supplies its result to the caller.
- valuekind of · A value is a quantity, datum, or measure of significance attributed to or represented by an entity, property, expression, or outcome.
- functionproduced by · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
Questions about return value
What is return value?
A return value is the result produced by a function, method, or operation and supplied to the code that invoked it.
Which Manning books explain return value?
Python How-To, The Well-Grounded Rubyist, Fourth Edition, Learn AI-Assisted Python Programming, Second Edition, The Art of Unit Testing 3e, The Quick Python Book, Fourth Edition, The Well-Grounded Python Developer: How the pros use Python and Flask, Grokking Simplicity and Statistics Slam Dunk.
What should I know before learning return value?
Manning books that teach return value usually introduce function, call, class and asynchronous programming first.
What is return value a kind of?
Return value is a kind of value. A value is a quantity, datum, or measure of significance attributed to or represented by an entity, property, expression, or outcome.
What is return value also called?
Return value is also called returned value.
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.







