Learn Interfaces by Building an Equation Solver - Step 64

Tell us what’s happening:

KEPT GETTING THAT solver fn. err. went through almost all the questions asked; secondly also tried searching on chatgpt couldnt yet figure out(btw this is my very first question asked)

Your code so far

# User Editable Region

    details = equation.analyze()
    match details:
        case {'slope': slope, 'intercept': intercept}:
            details_list = [f"slope = {slope:.3f}", f"y-intercept = {intercept:.3f}"]
        case {'x': x, 'y': y, 'min_max': min_max, 'concavity': concavity}:
            details_list = [f"concavity = {concavity}", f"{min_max} = ({x:.3f}, {y:.3f})"]  
    for detail in details_list:
        output_string += f"{detail:^24}\n"
    output_string += "\n"
   

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 OPR/116.0.0.0

Challenge Information:

Learn Interfaces by Building an Equation Solver - Step 64

Welcome to the forum @Mohammad-Asaad-Sayed

image

Looks like there is extra spacing before the output text.

Also, you only need one new line character at the end.
After the for loop it looks like you added an extra one.

Happy coding

details = equation.analyze()
    match details:
        case {'slope': slope, 'intercept': intercept}:
            details_list = [f"slope={slope:.3f}", f"y-intercept={intercept:.3f}"]
        case {'x': x, 'y': y, 'min_max': min_max, 'concavity': concavity}:
            coord = f'({x:.3f}, {y:.3f})'
            details_list = [f'concavity = {concavity}', f'{min_max} = {coord}'] 
    for detail in details_list:
        output_string += f"{detail:^24}\n"
    
    output_string = output_string.rstrip()

SAME ERROR

Hi @Mohammad-Asaad-Sayed

Here is a comparison of the original code and your code.

The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.

It looks like you modified the existing code.

The first hint message:

Your solver function should return a different string.

The current hint message:

You should not modify your existing case block.

Please reset the step to restore the original code and try again.
Do not modify code you are not asked to modify, doing so will intefer with the tests.

Happy coding

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').