Try problem

SamG mad.vijay at gmail.com
Fri Apr 13 05:14:02 EDT 2007


import sys
try:
     s=1
     if s==1:
          sys.exit(0)
     else:
          sys.exit(1)
except SystemExit,s:
     if (s==0):
          print s
     else:
          print "Hello"

How come i always end up getting the "Hello" printed on the screen as
logically i should a '0' printed?




More information about the Python-list mailing list