方法一:
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
方法二:
适用于python3
s = "hello world"
hasattr(s, "__iter__")
发布时间:2019-10-16 17:29:49编辑:auto阅读(2361)
适用于python2和python3
>>> from collections import Iterable
>>> isinstance("str", Iterable)
True
适用于python3
s = "hello world"
hasattr(s, "__iter__")
上一篇: 基于python3.5+的web框架s
下一篇: VIM自动补全插件:deoplete
46412
44294
35748
33301
28004
24572
23499
18715
17956
16648
4476°
5039°
4567°
4714°
5375°
4331°
4389°
4937°
4830°
6071°