Which of the following is the correct syntax for inheritance in Python?

Options

  • A. class Derived inherits Base:
  • B. class Derived(Base):
  • C. class Base extends Derived:
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. class Derived(Base):

Detailed Explanation

Python inheritance is declared by placing the base class name inside parentheses after the derived class name.