Basic instance check
Input
is_instance(B(), A)
Output
True
B is a subclass of A, so an instance of B is an instance of A.
Full lesson preview
Learn to correctly determine instance and subclass relationships and handle invalid inputs safely.
Problem statement
Task
Examples
Input
is_instance(B(), A)
Output
True
B is a subclass of A, so an instance of B is an instance of A.
Input format
Output format
Constraints
Samples
Input
is_subclass(C, A)
Output
True
C inherits from B which inherits from A.