[python] appending list but error 'NoneType' object has no attribute 'append'