Skip to content

Instantly share code, notes, and snippets.

@ashwin
Created May 4, 2012 14:31
Show Gist options
  • Save ashwin/2595132 to your computer and use it in GitHub Desktop.
Save ashwin/2595132 to your computer and use it in GitHub Desktop.
None returned by function in Python
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