1、'float ’ object can't be interpreted as an integer'
例:for i in range(int(c / 10)):
改为:for i in range(c // 10):
注:‘/’ 表示除法; '//'表示整除
2、‘'int' object does not support item assignment’
例:array[i][j] = i * j
改为:array = [x * j for i in range(y)]
3、<generator object <genexpr> at 0x1006aocbo>
原因:产生的结果过于庞大
4、‘‘dict’ object has no attribution 'has_key'’
原因:版本原因
例:if dict.has_key('id')
改为:if id in dict:
5、list indices must be: integers or slices, not str
例:for i in A: A是某个常量
改为:for i in range(A)
6、'process_file( ) take 1 positional argument but 2 were given'
例:dict = process_file('outfile_path','r')
解决办法:将‘r’去掉,因为只需要1个参数
7、local