Tell us what’s happening:
i’m so confused the nameerror im getting makes no sense i haven’t called on a variable that isnt there
Your code so far
from abc import ABC, abstractmethod
class Equation(ABC):
degree: int
def __init__(self):
pass
# User Editable Region
def __init_subclass__(cls):
pass
@abstractmethod
def solve(self,):
pass
@abstractmethod
def analyze(self):
pass
if not hasattr(cls,'degree'):
raise AttributeError(f"Cannot create '{cls.__name__}' class: missing required attribute 'degree'")
class LinearEquation(Equation):
degree: int = 1
# User Editable Region
def solve(self):
pass
def analyze(self):
pass
lin_eq = LinearEquation()
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Challenge Information:
Learn Interfaces by Building an Equation Solver - Step 11