python float object has no attribute ‘append‘怎么回事
意思是append()可以将python object对象添加到列表list的末尾。append()方法的用法实例。
·
float object has no attribute 'append'
在python的编程开发过程中,python抛出float object has no attribute 'append'的AttributeError,其大意就是python的float类型的对象没有append属性或方法,即float对象无法调用append()方法,而且append()方法只能被列表list对象调用,可参考python源码对该方法的介绍,如下:
append(self, object, /)
Append object to the end of the list.
意思是append()可以将python object对象添加到列表list的末尾。
python全栈:笨鸟工具,python全栈
append()方法的用法实例
>>> a = []
>>> a.append('abc')
>>> a
['abc']
>>> a.append('def')
>>> a
['abc', 'def']
更多推荐



所有评论(0)