Python 程序中遇到 'float' object has no attribute '__getitem__'
2016-12-27 16:11
3159 查看
是误将float当作list或者tuple来操作了,对于list或者元组,[]操作是访问下标所在的元素,也就是__getitem__方法。
由于python定义变量的时候并不说明类型,类型都在运行时确定,因此有出现类型错误的可能性。
由于python定义变量的时候并不说明类型,类型都在运行时确定,因此有出现类型错误的可能性。
相关文章推荐
- python :TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- python:TypeError: 'coo_matrix' object has no attribute '__getitem__'
- python object has no attribute '__getitem__'
- python 编译错误TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- python遇到AttributeError: 'str' object has no attribute '_getAssertEqualityFunc'问题解决过程
- 部署爬虫到scrapy cloud上出现'_sre.SRE_Match' object has no attribute '__getitem__'的错误
- TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'(已解决)
- 执行Python程序时,报AttributeError: 'function' object has no attribute 'name'
- 'NoneType' object has no attribute '__getitem__'和argument of type 'NoneType' is not iterable 异常的解决办法
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- TypeError: 'generator' object has no attribute '__getitem__'
- 【转载】C#调用python文件时出现'module' object has no attribute '_getframe'
- Spark Reduce TypeError: 'int' object has no attribute '__getitem__
- TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- 'generator' object has no attribute '__getitem__'
- python PIL bug: 'NoneType' object has no attribute 'bands' (解决)
- python 使用scapy包告警WARNING: can't import layer inet: 'module' object has no attribute 'IPPROTO_IPIP'
- [Python][转]Exception AttributeError: "'NoneType' object has no attribute
- 【python问题系列--3】TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'