Python Multiple try-except can handle Multiple exceptions. Just mention the exception names, comma-separated inside parentheses, just after except keyword.
try: ... except (URLError, ValueError, SocketTimeout): ....
try: ... except (URLError, ValueError): ... except SocketTimeout: ...
Multiple try except Python
Simple example code.
s = input() try: num = int(input()) print(s + num) except (TypeError, ValueError) as e: print(e)
Do comment if you have any doubts or suggestions on this Python exception-handling topic.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.