recursive function return value problems
Brian L. Troutwine
goofyheadedpunk at gmail.com
Wed Dec 28 18:55:53 EST 2005
More information about the Python-list mailing list
Wed Dec 28 18:55:53 EST 2005
- Previous message (by thread): recursive function return value problems
- Next message (by thread): recursive function return value problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
randomtalk at gmail.com wrote: >>>>def reTest(bool): > > ... result = [] > ... if not bool: > ... reTest(True) > ... else: > ... print "YAHHH" > ... result = ["should be the only thing returned"] > ... print "printing result: " > ... print result > ... return result > ... > >>>>reTest(False) You're both printing the result and returning it. The interpreter just happens to show both printed and returned variables. An example of a shown return variable: >>>def returnb(): ... return 'b' ... >>>returnb() 'b' Hope that helps, Brian -- What if the Universe were a chrooted environment with everything symlinked from the host?
- Previous message (by thread): recursive function return value problems
- Next message (by thread): recursive function return value problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list