# Python 3.10 Traceback (most recent call last): File "calc.py", line 2, in <module> result = 100 / (50 - 50) ZeroDivisionError: division by zero Traceback (most recent call last): File "calc.py", line 2, in <module> result = 100 / (50 - 50) ~~~~^~~~~~~~~~~~ ZeroDivisionError: division by zero
# Python 3.11+ from asyncio import gather, sleep async def risky_task(name, fail): await sleep(0.1) if fail: raise ValueError(f"name failed") return name python 3.11
ExceptionGroup and except* .