The Big if (What did I do wrong?)


Return is outside function
File "python", line 11
SyntaxError: 'return' outside function

I dont understand why return is outside of the function, indentation maybe...?

Replace this line with your code. 

def the_flying_circus(): True
if (1 == 1) and (17 != 38):  
    print "Hello Jordan! YES, the code worked... (for once)"
elif the_flying_circus() == False:
    print "!*#%@$@#!#, the code didn't work... (as expected)"

    print "Just give up..."
    return True


The code is set up with included return statements. Why remove them? READ the instructions closely, and start by Reseting your exercise to get rid of all the GIGO.


When I try something different

def the_flying_circus():

if (1 != 1) or (1 == 1):  
    print "True"

elif (1 <= 1) and (2 <= 2):
    print "False"   

    print "False"

I get the message "the_flying_circus() returned the value of None, did you forget to add a return statement?"
Which makes me think that a return statement is needed. How would I fix that problem?


By following the instructions. Instead of printing a string value for True or False, return the boolean.

return True


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