Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. # 你可以将 else 子句作为 try/except 块的一部分,如果没有抛出异常,则执行该子句。
  2. try:
  3. 2*3
  4. except TypeError:
  5. print("An exception was raised")
  6. else:
  7. print("Thank God, no exceptions were raised.")
  8. #Thank God, no exceptions were raised.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement