๐Ÿ”ฅ Welcome to my blog! Latest updates available now. Visit daily! ๐Ÿ”ฅ ๐Ÿ”ฅ Click Here for Latest Updates – Visit My Blog ๐Ÿ”ฅ
๐Ÿ”ฅ Latest Updates ๐Ÿ“Š GP Grade Finder ๐Ÿ“ข Government Services Info ๐Ÿ†• New Schemes Updates

Default Exception Handling in Python



๐Ÿ‘‰Every exception in Python is an object. 

๐Ÿ‘‰For every exception type, the 

     corresponding classes are available.

๐Ÿ‘‰Whenever an exception occurs, PVM will create the corresponding exception object and will check for handling code. 

๐Ÿ‘‰If handling code is not available, then the Python interpreter terminates the program abnormally and prints corresponding exception information to the console.

๐Ÿ‘‰The rest of the program won’t be executed.

Ex:Python1.py

1) print("Hello")

2) print(10/0)

3) print("Hi")

Output:


D:\Python3>py Python1.py

Hello

Traceback (most recent call last):

  File "test.py", line 2, in <module>

    print(10/0)

ZeroDivisionError: division by zero

No comments:

Post a Comment

Thank you Very Much.For Given Comment

Quatation of the Day 22-03-2026