處理不同類型的例外。
try: num = int(input("輸入數字:")) result = 10 / num except ValueError: print("請輸入有效數字") except ZeroDivisionError: print("不能除以零")