Certified Associate in Python Programming (PCAP) — Question 98
A function called issubclass (c1, c2) is able to check if:
Answer options
- A. c1 and c2 are both subclasses of the same superclass
- B. c2 is a subclass of c1
- C. c1 is a subclass of c2
- D. c1 and c2 are not subclasses of the same superclass
Correct answer: C
Explanation
The function issubclass(c1, c2) checks if c1 is derived from c2, meaning it verifies if c1 is a subclass of c2. Options A, B, and D do not accurately describe the relationship established by issubclass, as they focus on different subclass relationships or the absence of such relationships.