1. try:
    2. year = int(input())
    3. print(type(year), year)
    4. except ValueError:
    5. print('num')
    6. except (ZeroDivisionError, AttributeError):
    7. print('za')
    8. except Exception as e:
    9. print(e)
    10. finally:
    11. print('finally')
    12. # 自定义异常
    13. try:
    14. raise NameError('helloError')
    15. except NameError:
    16. print('ff')