Which function checks whether an object is an instance of a class in Python?
Correct answer
D. isinstance()
7 views
D. isinstance()
7 views
isinstance(obj, cls) returns True if obj is an instance of cls or a subclass.
Asked in: Python Interview OOP
https://docs.python.org/3/tutorial/classes.htmlNot sure why the answer is D? Ask here and get an explanation.