Skip to content

Instantly share code, notes, and snippets.

@weihanchen
Created September 15, 2023 11:40
Show Gist options
  • Save weihanchen/88f2eff9a043baf3ae10a10fae10dc50 to your computer and use it in GitHub Desktop.
Save weihanchen/88f2eff9a043baf3ae10a10fae10dc50 to your computer and use it in GitHub Desktop.
def raise_example(num: int):
try:
if num <= 10:
raise ValueError(f"{num} 必須大於10")
except ValueError as e:
print(e)
raise
raise_example(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment