Closed BielStela closed 1 year ago
Don't use:
try: 1/0 except: print('something did not work')
will print something did not work
something did not work
Always catch the exception (even with generic exception class Exception):
Exception
try: 1/0 except Exception as e: print(f' something did not work. Cause: {e}')
will print something did not work. Cause: division by zero
something did not work. Cause: division by zero
Let's build a better world together
Don't use:
will print
something did not work
Always catch the exception (even with generic exception class
Exception
):will print
something did not work. Cause: division by zero
Let's build a better world together