Else Problems, I Feel Bad for You, Son


#1

Conditionals & Control Flow
13 ,Else Problems, I Feel Bad for You, Son

How is pls?

this not work ,


answer = "'Tis but a scratch!"

def blackknight1():
if answer == "'Tis but a scratch!":
return True
else:
print "This pain is too much!"
return False

def french_soldier():
if answer == "Go away, or I shall taunt you a second time!":
return True
else:
print "This ■■■■ hurts!"
return False


#2

You still have to call your function. At the end of your code just write:

blackknight1()
french_soldier()

Also watch your indentation.


#3

this , there was yes bad word
but I have see this on youtube lol

see pls https://www.youtube.com/watch?v=O9u6CNAeJ2I

on my codecademy why not work and for youtube user , this same thing work


#4

blackknight1()
french_soldier()
Also watch your indentation

how you mean?


#5

File "python", line 4
if answer == "'Tis but a scratch!":
^
IndentationError: expected an indented block


#6

Try this code instead:

answer = "'Tis but a scratch!"

def blackknight1():
    if answer == "'Tis but a scratch!":
        return True
    else: 
        print "This pain is too much!"
        return False

def french_soldier():
    if answer == "Go away, or I shall taunt you a second time!":
        return True
    else:
        print "This ■■■■ hurts!"
        return False

 french_soldier()  #You still need to call your fucntions after defining them.
 blackknight1()

#7

it says my fourth line is wrong. the 'if answer == "'Tis but a scratch!":
its exactly the same as on here i have no idea what is wrong


#8

`answer = "'Tis but a scratch!"

def black_knight():
if answer == "'Tis but a scratch!":
return True
else:
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:
return False # Make sure this returns False`


#9

check parenthesis for "'Tis but a scratch!'".


#10

answer = "'Tis but a scratch!"

def black_knight():
if answer == "'Tis but a scratch!":
return True
else:
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:
return False # Make sure this returns False

Your answer is here read the Hint carefully
To complete your else statement lines, the only thing you need to do is add False after the returns on lines 8 and 14.