how to check if variable is of the type string code example Example: if type is string python isinstance(s, str)