wizardforcel / sicp-py-zh

:book:【译】UCB CS61a SICP Python
https://www.gitbook.com/book/wizardforcel/sicp-py/details
2.2k stars 333 forks source link

wrong location code in 3.4 异常 #17

Open EricDong opened 2 years ago

EricDong commented 2 years ago

handling a <class 'ZeroDivisionError'> should below >>>x

>>> try:
        x = 1/0
    except ZeroDivisionError as e:
        print('handling a', type(e))
        x = 0
handling a <class 'ZeroDivisionError'>
>>> x
0