Handling exception
## try , except, else, finally
## this is structure:-
try:
x=10/0
except ZeroDivisionError:
print("zero cant divide any number")
else:
print("no error")
"C:\Users\darul Haram\PycharmProjects\pythonProject2\venv\Scripts\python.exe" "C:/Users/darul Haram/PycharmProjects/pythonProject2/venv/Lib/Handling exceptions.py"
zero cant divide any number
Process finished with exit code 0
Comments
Post a Comment