Return Statement

Alexander Kapps alex.kapps at web.de
Wed Jan 26 16:46:02 EST 2011


On 26.01.2011 21:26, sl33k_ wrote:
> How does "return True" and "return False" affect the execution of the
> calling function?

If only affects the calling function if you use the return value:
def foo():
 return True
def bar1():
 foo() # nothing difference, whether foo() returns True or False
def bar2()
 if foo():
 print "foo returned True or any other non-false value"
 else:
 print "foo returned False or any other non-True value"


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /