Failing to import itertools in Python 3.5.2

后端 未结 2 1684
深忆病人
深忆病人 2020-12-09 16:13

I am new to Python. I am trying to import izip_longest from itertools. But I am not able to find the import \"itertools\" in the preferences in Python interpreter. I am usin

2条回答
  •  眼角桃花
    2020-12-09 17:10

    One of the simple way of importing any feature is through object importing(ex: import itertools as it) unless you want to hide other features. Since features in modules does change according to python version, Easy way to check whether the feature is present in module is through dir() function. import itertools as it dir(it) It'll list all the features in it

提交回复
热议问题