TypeError: 'NoneType' object is not iterable
1. 将None赋给多个值时,会出现提示:TypeError: 'NoneType' object is not iterable
2. 函数返回值一定要考虑到条件分支的覆盖
3. 在没有return语句时,python默认会返回None(return返回数据为空)
本文深入探讨了Python中常见的TypeError:'NoneType'objectisnotiterable错误,分析了错误产生的原因,强调了函数返回值在条件分支覆盖中的重要性,并解释了Python默认返回None的行为。
TypeError: 'NoneType' object is not iterable
1. 将None赋给多个值时,会出现提示:TypeError: 'NoneType' object is not iterable
2. 函数返回值一定要考虑到条件分支的覆盖
3. 在没有return语句时,python默认会返回None(return返回数据为空)
386
1425
985
26万+

被折叠的 条评论
为什么被折叠?
