Learn Interfaces by Building an Equation Solver - Step 16

Tell us what’s happening:

my mind is boggled on how to get the highest degree coefficent please someone point me in the write direction and i’ll continue myself i really don’t know how to do this, also am i getting dumber or are these projects getting harder, i could do a project in a day not too long ago now its taking me 3-4 days

Your code so far

from abc import ABC, abstractmethod

class Equation(ABC):
    degree: int

# User Editable Region

    def __init__(self, *args):
        if (self.degree + 1) != len(args):
            raise TypeError(
                f"'Equation' object takes {self.degree + 1} positional arguments but {len(args)} were given"
            )
        if any(not isinstance(arg, (int, float)) for arg in args):
            raise TypeError("Coefficients must be of type 'int' or 'float'")
        if not self.degree == 0:
            raise ValueError('Highest degree coefficient must be different from zero')

# User Editable Region

    def __init_subclass__(cls):
        if not hasattr(cls, "degree"):
            raise AttributeError(
                f"Cannot create '{cls.__name__}' class: missing required attribute 'degree'"
            )        
    
    @abstractmethod
    def solve(self):
        pass
        
    @abstractmethod
    def analyze(self):
        pass
        
class LinearEquation(Equation):
    degree = 1
    
    def solve(self):
        pass
    
    def analyze(self):
        pass
    
lin_eq = LinearEquation(2, 3)

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 16

also i know it should be !=

You are mixing up “degree” and “coefficient”

checking that the highest degree coefficient is different from zero

Check the coefficient, not the degree.

These might help:
https://www.cuemath.com/algebra/coefficient/

https://www.theproblemsite.com/reference/mathematics/algebra/polynomials/terms-coefficients-degree

Pay attention to this instruction:

Remember that the highest degree coefficient should be passed as the first argument when instantiating the object.