Learn the Bisection Method by Finding the Square Root of a Number - Step 6

Tell us what’s happening:

the step is telling me to assign the value 1 to the root variable and print the message ‘The square root of {square_target} is 1’ inside the function body but what am I missing because it keeps telling me to do that and I swear that I’ve done everything right but it is still throwing me an error.

Your code so far


# User Editable Region

def square_root_bisection(square_target, tolerance=1e-7, max_iterations=100):
    if square_target < 0:
        raise ValueError('Square root of negative number is not defined in real numbers')
    if square_target == 1:
        root == 1
        print('The square root of {square_target} is 1')


# 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/133.0.0.0 Safari/537.36

Challenge Information:

Learn the Bisection Method by Finding the Square Root of a Number - Step 6

read the last sentence of the instructions

I have tried an f-string but It doesn’t want to let me pass

what is your code with an f-string?

my code is print(f'the square root of {square_target} is 1’)

do I need a backslash or something?

uhm… how do you assign a value to a variable?

I tired both 1 equal sign and 2 equal signs neither let me pass

and which one of the two is the one that assign?

I test the code with 1 equal sign, my code doesn’t pass, I try 2 equal signs again another fail I’m starting to get a little annoyed with this.

it just passed the string was needed to have an f before the single quotes and I needed 1 equal sign

yes, you need to both use an f-string and use the assignment operator