java 的 try catch finally 对应 python3 的 try except finally
python3 写成这样:
try: #
1 / 0
except Exception as e:
print( "Exception: ", e ) # 打印 Exception: division by zero
finally:
print( "finally" ) # 打印 finally
#
python2 写成这样:
try: #
1 / 0
except Exception, e:
print "Exception: ", e
finally:
print "finally"
#