AttributeError: 'generator' object has no attribute 'next'
时间: 2023-06-21 19:19:31 浏览: 244
Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
5星 · 资源好评率100%
This error occurs when you are trying to access the next element of a generator object using the `.next()` method which does not exist in Python 3.x. Instead, you should use the built-in `next()` function.
For example, if you have a generator object `gen` and you want to access the next element, you should use:
```
next(gen)
```
This will return the next element of the generator object.
阅读全文