方法一:
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
方法二:
适用于python3
s = "hello world"
hasattr(s, "__iter__")
发布时间:2019-10-16 17:29:49编辑:auto阅读(2764)
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
适用于python3
s = "hello world"
hasattr(s, "__iter__")
上一篇: 基于python3.5+的web框架s
下一篇: VIM自动补全插件:deoplete
48301
47095
37976
35269
29764
26442
25388
20384
20069
18517
23°
34°
65°
137°
115°
312°
172°
159°
225°
364°