I want to do the same thing for err1 and err2 Do I have to write it separately like that?
try:
# Error Code
except err1 :
pass
except err2 :
pass
The method is slightly different depending on the Python version.
#Method1
try:
print(1/0)
except (ZeroDivisionError, ArithmeticError) :
print(3)
#How2
try:
print(1/0)
except ZeroDivisionError, ArithmeticError :
print(3)
Method 1 and 2 differ only in parentheses. Python 2.6 and 2.7 are both ways If it's Python 3 or higher, you can only use Method 1.
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
581 PHP ssh2_scp_send fails to send files as intended
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.