1. 不要使用 a = a.append(a, b)
直接写为 a.append(a, b)
原因:append会修改a本身,并且返回None。不能把返回值再赋值给a。从而产生'NoneType错误'
AttributeError: 'NoneType' object has no attribute 'append'
1. 不要使用 a = a.append(a, b)
直接写为 a.append(a, b)
原因:append会修改a本身,并且返回None。不能把返回值再赋值给a。从而产生'NoneType错误'
AttributeError: 'NoneType' object has no attribute 'append'