Home >>Python Built-in Functions >Python isinstance() Function
Python isinstance() function is used to return True value if the given input object is of the specified type otherwise it will return False. If the type parameter is a tuple then this function will return True if the given input object is one of the types in the tuple.
Syntax:isinstance(object, type)
Parameter | Description |
---|---|
object | This is a required parameter. It defines the given object. |
type | This parameter defines a type or a class or a tuple of types. |
x = isinstance(10, int)
print(x)
x = isinstance("Jerry", (str, float, int, str, list, dict, tuple))
print(x)