Skip to content

Instantly share code, notes, and snippets.

@sanfx
Created April 8, 2014 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanfx/10113339 to your computer and use it in GitHub Desktop.
Save sanfx/10113339 to your computer and use it in GitHub Desktop.
if ther is not exception then else block will execute, but if error occurs
value = None
try:
print "in try"
value = int(input())
print "No Error Occured"
except:
print "In Except: Value: %s" % value
else:
print "In else: Value %s" % value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment