import sys
class test1:
def __init__(self) :
print"intialized"
def yrt(self):
try:
name="gokl"
age="24"
address="hjk"
pincode=516101
#print "My name is %s,and my age is %s, my address is %s and my pincode is " %(name,age,address)
**print name+pincode**
except Exception, hj:
sys.exit(1)
if __name__ == "__main__":
gh=test1()
try:
gh.yrt()
except Exception, ex :
sys.exit(1)
sys.exit(0)
答案 0 :(得分:0)
你明确地抓住了这个错误并使其无声。如果你想抛出它,你就不应该抓住它。