AttributeError: 'itertools.cycle' object has no attribute 'next'

AttributeError: 'itertools.cycle' object has no attribute 'next'

上面程序在运行时遇到AttributeError: 'itertools.cycle' object has no attribute 'next'错误,原因是版本问题,只需要将indexer1.next()改为next(indexer1)即可。