我正在尝试处理 f 字符串中的错误,但我的尝试似乎不起作用。有没有办法做到这一点?
string = f"For example I thought this syntax would work but it doesn't {try: 5/0 except Exception: str(infinity)}"
python error-handling python-3.x f-string
error-handling ×1
f-string ×1
python ×1
python-3.x ×1