方法一:
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
方法二:
适用于python3
s = "hello world"
hasattr(s, "__iter__")
发布时间:2019-10-16 17:29:49编辑:auto阅读(2817)
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
适用于python3
s = "hello world"
hasattr(s, "__iter__")
上一篇: 基于python3.5+的web框架s
下一篇: VIM自动补全插件:deoplete
48555
47515
38330
35567
30022
26735
25716
20639
20368
18772
121°
165°
175°
170°
180°
223°
247°
371°
349°
320°