Tools, FAQ, Tutorials:
'return' Statement in Function Statement Block
How to use the "return" statement in a function statement block in Python?
✍: FYIcenter.com
The "return" statement can be used in a function statement block to terminate
the execution of the function and return a data object to the calling expression.
Here is a good example of "return" statement used in a function statement block:
>>> def fib(n): ... """Return a Fibonacci series up to n.""" ... out = [] ... a, b = 0, 1 ... while a < n: ... out.append(a) ... a, b = b, a+b ... else: ... return out ... >>> fib(2000) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597]
⇒ Function Calling Expressions
⇐ 'def' - Function Definition Statements
2018-02-28, ∼1944🔥, 0💬
Popular Posts:
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
What is EPUB 3.0 Metadata "dcterms:modified" property? EPUB 3.0 Metadata "dcterms:modified" is a req...
How to access Request body from "context.Request.Body" object in Azure API Policy? Request body is t...
Where to find tutorials on HTML language? I want to know how to learn HTML. Here is a large collecti...
How to Install Docker Desktop on Windows 10? You can follow this tutorial to Install Docker Desktop ...