What's the difference between generating a value and returning a value?
davea at ieee.org
Tue Mar 24 12:48:57 CET 2009
Clearly, there's no difference, from the wording you quoted. He uses
three words more or less interchangeably, "produced", "generated" and
The distinction he's making is not between these words, but between the
built-in functions, which are already returning values, and the ones
that he has had the user write so far, that do not.
> Taken from the url....
> "The built-in functions we have used, such as abs,
> pow, and max, have produced results. Calling each of
> these functions generates a value, which we usually assign to a
> variable or
> use as part of an expression.
> biggest = max(3, 7, 2, 5)
> x = abs(3 - 11) + 10
> But so far, none of the functions we have written has returned a
> In this chapter, we are going to write functions that return values,
> we will call fruitful functions,"
> So what's the difference between generating a value and returning a
More information about the Python-list