Back to Freecodecamp

Step 4

curriculum/challenges/english/blocks/learn-interfaces-by-building-an-equation-solver/662bd8260da84bdd5feae419.md

latest1.1 KB
Original Source

--description--

You want the LinearEquation class to implement and not simply inherit all the methods defined inside the Equation class, which should act as an interface.

Currently, the Equation class is simply the parent class of LinearEquation. In the next steps you will learn how to turn it into a formal interface.

For now, create an instance of Equation and assign it to a variable eq, and an instance of LinearEquation and assign it to a variable lin_eq.

--hints--

You should declare a variable eq and assign it an instance of Equation.

js
({ test: () => assert(runPython(`_Node(_code).has_stmt("eq = Equation()")`)) })

You should declare a variable lin_eq and assign it an instance of LinearEquation.

js
({ test: () => assert(runPython(`_Node(_code).has_stmt("lin_eq = LinearEquation()")`)) })

--seed--

--seed-contents--

py
class Equation:
    def solve(self):
        pass
        
    def analyze(self):
        pass
        

class LinearEquation(Equation):
    pass
--fcc-editable-region--

--fcc-editable-region--