validate string using six library python code example Example: validate string using six library python from six import string_types isinstance(s, string_types)