Python Common exceptions in
1、 Divisor zero exception (ZeroDivisionError)
# coding:utf-8
print(10/0)
2、 Invalid index exception (IndexError)
# coding:utf-8
lis = [1, 2, 3, 4]
print(lis[4])
3、 Data type mismatch exception (TypeError)
# coding:utf-8
print(1 > 'hj')
4、 Invalid key value exception (KeyError)
# coding:utf-8
dic = {"code":1001, "name":"zhang"}
print(dic["key"])
5、 Grammatical anomalies (SyntaxError)
# coding:utf-8
int a = 1
6、 The parameter value is abnormal (ValueError)
# coding:utf-8
a = int('hj')