Back to Freecodecamp

Step 6

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

latest1.1 KB
Original Source

--description--

ABC stands for Abstract Base Classes. The ABC class enables you to turn a regular class into an abstract class, which is a class that acts as a blueprint for concrete classes.

Modify your import statement to import just the ABC class from the abc module. You can import a specific object x from a module y following the import construct from y import x.

Then, turn your Equation class into an abstract class by making it inherit from ABC.

--hints--

You should import ABC from the abc module.

js
({ test: () => assert(runPython(`_Node(_code).has_import("from abc import ABC")`)) })

Your Equation class should inherit from ABC.

js
({ test: () => assert(runPython(`_Node(_code).find_class("Equation").inherits_from("ABC")`)) })

--seed--

--seed-contents--

py
--fcc-editable-region--
import abc


class Equation:
    def solve(self):
        pass
        
    def analyze(self):
        pass
        
class LinearEquation(Equation):
    pass
    
eq = Equation()
lin_eq = LinearEquation()
--fcc-editable-region--