The Big If


def the_flying_circus():

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

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

    print "I did this wrong" 

print the_flying_circus("Danny")

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


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".


@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)


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