SyntaxFix
Write A Post
Hire A Developer
Questions
How about: hasattr(a, "__iter__") ?
hasattr(a, "__iter__")
It tells if the object returned can be iterated over as a generator. By default, tuples and lists can, but not the string types.