Using loops within functions
In Python function will be returned as soon as execution hits "return" statement.
Return statement inside loop in a function
In this example, function will return as soon as value var has 1
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0
This website is not affiliated with Stack Overflow