The Big If


#1

def the_flying_circus():

if answer == "Steve" or answer == "Mark":   
    return "I did this wrong"

elif answer == "Danny":
    return "True"

else:
    print "I did this wrong" 

print the_flying_circus("Danny")

***I'm supposed to print "True", what am I missing?


#2

You have not checked what answer is anywhere in you code. There has to be somewhere in your code where you set answer to "Danny".


#3

@wateryourroots513, you must pass the variable "answer" through the print method, else you are only passing a static string "Danny", meaning it will always return "Danny" even if the variable "answer" changes to something else.

Try this:

print the_flying_circus(answer)


#4

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