方法一: 適用於python2和python3>>> from collections import Iterable >>> isinstance("str", Iterable) True方法二: 適用於python3s = "hello world" hasattr(s, "__iter__") 更多[python][