How should you design SmartPhone to properly initialize both parents following best practices?
hard📝 Application Q15 of 15
Python - Multiple Inheritance and Method Resolution
You want to create a class SmartPhone that inherits features from Camera and Phone. Both parents have an __init__ method. How should you design SmartPhone to properly initialize both parents following best practices?
ADefine <code>SmartPhone.__init__</code> and call <code>super().__init__()</code> only once, relying on parents to use super() too
BDefine <code>SmartPhone.__init__</code> but leave it empty
CDo not define <code>__init__</code> in <code>SmartPhone</code>, parents will initialize automatically
DDefine <code>SmartPhone.__init__</code> and call <code>Camera.__init__(self)</code> and <code>Phone.__init__(self)</code> directly