当尝试在 Windows 10 上运行的 Python Jupyter 2.7 nb 上导入此函数时,出现此错误:
我相信我过去没有遇到过问题,因为我使用的是 Python 3。所以我想知道是不是它在 Python 2 中不可用,或者是否有办法让它工作。
最佳答案
对于 Python 3,方法是 zip_longest
:
from itertools import zip_longest
对于 Python 2,方法是 izip_longest
:
from itertools import izip_longest
关于python - 如何使用 Python 2.7 在 itertools 中使用 zip_longest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44478119/