Problem in conditional and control flow


#1

I am completely lost here.How to fix it?

answer = "'Tis but a scratch!"

def black_knight():
if answer == "'Tis but a scratch!":
return True
else:
return # Make sure this returns False
False
def french_soldier():
if answer == "Go away, or I shall taunt you a second time!":
return False
else:
return "Make sure this returns False !"


#2

The return statement for your first if else block should be on one line,

 else:             
        return False       # Make sure this returns False

And your french soldier function is supposed to return True if the answer is, "Go away, or I shall taunt you a second time!" and not False meaning your else statemne should then return False and not a string. :slight_smile:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.