原文:TypeError: person is not iterable关于for of报错

TypeError: person is not iterable关于for of报错 因为普通对象不可迭代,而for of 循环仅适用于迭代。 那么可以用for of 遍历什么呢 for of 允许你遍历 Arrays 数组 , Strings 字符串 , Maps 映射 , Sets 集合 等可迭代的数据结构等。 语法 variable:每个迭代的属性值被分配给该变量。 iterable:一 ...

2020-01-22 17:05 0 688 推荐指数:

查看详情

TypeError: 'TestCase' object is not iterable

这个异常呢其实是因为我对list没有足够熟悉 我一开始很疑惑,明明已经正确返回testcase对象了呀,为啥会报TypeError: 'TestCase' object is not iterable这个错误 呢? 分析: 这个错误的意思是说TestCase这个对象是不可迭代的(注意到 ...

Thu Jun 20 01:12:00 CST 2019 0 700
TypeError: 'ExcelData' object is not iterable

今天写了个测试的代码,结果在执行test_register.py文件在调用readexcle.py的时候一直报错TypeError: 'ExcelData' object is not iterable,最后发现是test_register.py模块调用readexcle.py模块时,忘记调用方法 ...

Fri Dec 29 22:59:00 CST 2017 0 4285
TypeError: 'NoneType' object is not iterable

报错原因:对 None 进行迭代 报错TypeError: 'NoneType' object is not iterable 解决: d2 没有 key 为 “cc” 所以 x 可能为 None 对None 进行迭代 会报错 ...

Mon Mar 21 21:18:00 CST 2022 0 667
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM