Python isinstance() function

The isinstance() function in Python returns a Boolean value ‘True’ if the given object is of the specified type, otherwise it returns False.

Syntax

Parameter

object: It is a required parameter which represents an object.

classinfo: This parameter represents a type or a class, or a tuple of types and/or classes

Return

This function returns a Boolean value ‘True’ if the given object is of the specified type, otherwise it returns False.

Example 1

Output

Pin It on Pinterest

Share This