Indentation Error in Else Problems, I feel bad for you, son


#1



I can't get this to work! I have spent way too long on it. Please help. I have indented the else and if, so I really can't see why it is giving me an indentation error.

https://www.codecademy.com/en/courses/python-beginner-BxUFN/3/3?curriculum_id=4f89dab3d788890003000096#


File "python", line 7
return False # Make sure this returns False
^
IndentationError: unexpected indent


Success


answer = "'Tis but a scratch!"

def black_knight():
    if answer == "'Tis but a scratch!":
        return True
    else: "Peekaboo"             
        return False        # Make sure this returns False

def french_soldier():
    if answer == "Go away, or I shall taunt you a second time!":
        return True
    else: "Come back here"             
            return False        # Make sure this returns False


#2

@cssjumper28933,
In your french_soldier function
your return False statement
should have the same indentation as the 'return True' statement


#3

I tried this and it still doesn't work. Well, the error is picked up at line 7 anyway which is the second return under def black_night()


#4

@cssjumper28933,
Try it with

answer = "'Tis but a scratch!"

def black_knight():
    if answer == "'Tis but a scratch!":
        return True
    else: 
        # "Peekaboo"   ^v^            
        return False        # Make sure this returns False

def french_soldier():
    if answer == "Go away, or I shall taunt you a second time!":
        return True
    else: 
        # "Come back here"             
        return False        # Make sure this returns False

#5

Thank-you.

No idea what I was doing wrong still with regards to indentation.

But it worked :slight_smile: Appreciate it.