Skip to main content

Exception Handling in Python

 



try:
    f = open("Mylog.txt")

except Exception as e:
    print(e)

finally:
    print("\nIt will execute. If you want to close any file you want put code
                here because this use for cleanup code")
print("\nThis is improtant")



Comments