Created
September 15, 2023 11:40
-
-
Save weihanchen/88f2eff9a043baf3ae10a10fae10dc50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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