python check type by its string name code example Example: if type is string python isinstance(s, str)