📜  将 try 与 finally 块一起使用 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:15.953000             🧑  作者: Mango

代码示例1
#!/usr/bin/env python3

try:
    num = int(input("Enter the number: "))
    re = 100/num
except:
    print("Something is wrong")
else:
    print("result is ",re)
finally :
    print("finally program ends")

print('END')