Skip to content

Instantly share code, notes, and snippets.

@sanfx
Created April 8, 2014 11:47
Show Gist options
  • Select an option

  • Save sanfx/10113339 to your computer and use it in GitHub Desktop.

Select an option

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