Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 14)
14.
What is the purpose of the isinstance() function?
It checks if a variable is an instance of a specified class.
It determines if an object has a particular attribute.
It checks if two objects are of the same type.
It verifies if an object is iterable.
Answer: Option
Explanation:
The isinstance() function is used to check if a variable is an instance of a specified class or a tuple of classes. It returns True if the object is an instance of any of the given classes.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.