Created
May 4, 2012 14:31
-
-
Save ashwin/2595132 to your computer and use it in GitHub Desktop.
None returned by function in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo( x ): | |
print( x ) | |
y = foo( 10 ) | |
if y is None: | |
print( "foo returned None" ) # Printed | |
else: | |
print( "No, it did not!" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment