
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How does isinstance() function work in Python?
We can derive a class from multiple parent classes as follows −
class A: # define your class A ..... class B: # define your class B ..... class C(A, B): # subclass of A and B .....
We can use isinstance() function to check the relationships of two classes and instances.
The
isinstance(obj, Class)
boolean function returns true if obj is an instance of class Class or is an instance of a subclass of Class
- Related Articles
- How does issubclass() function work in Python?
- How does recursion function work in JavaScript?
- How does MySQL IF() function work?
- How does the bin2hex() function work in PHP?
- Type and isinstance in Python
- How does underscore "_" work in Python files?
- How does garbage collection work in Python?
- How does class inheritance work in Python?
- How does Overloading Operators work in Python?
- How does tuple comparison work in Python?
- How does ++ and -- operators work in Python?
- How does variable scope work in python?
- type and isinstance in Python program
- How does Python while loop work?
- How does a Python interpreter work?

Advertisements