Discuss / Python / ee

激了咕噜

#1 Created at ... [Delete] [Delete and Lock User]

from collections import Iterable isinstance('abc', Iterable) # str是否可迭代 True isinstance([1,2,3], Iterable) # list是否可迭代 True isinstance(123, Iterable) # 整数是否可迭代 False 在尝试这个代码时候 报错: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working


  • 1

Reply