Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 你可以将 else 子句作为 try/except 块的一部分,如果没有抛出异常,则执行该子句。
- try:
- 2*3
- except TypeError:
- print("An exception was raised")
- else:
- print("Thank God, no exceptions were raised.")
- #Thank God, no exceptions were raised.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement