The Big If


The Big If

The code worked, thats my problem.

I expected my code not to be able to run, but however, it did and I am confused. From my code, this is what I understand, in English.

If the answer is more than 5, return it as True,

or else, if the answer is not False (True) or equal to 5, return is as False

for all other cases, return False. My issue is the second line. Doesnt it contradict with my first line? If the answer is more than 5, return it as True, bit if the answer is True, return it as False? Doesn't that make everything False?

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if the_flying_circus > 5:    
        return True
    elif not False or the_flying_circus == 5:
        return False
        return False


The second condition won't execute if the first one was satisfied
Also, you're comparing a function to 5, that isn't really a meaningful comparison.. not that the function itself does anything useful


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