代码示例:(标识:python_ref_iter)
python_ref_iter.py
x = iter(["apple", "banana", "cherry"])
print(next(x))
print(next(x))
print(next(x))
运行结果: