SyntaxError: 'return' outsde function - Please Help!


#1

This is the link to the exercise ->https://www.codecademy.com/en/courses/python-beginner-BxUFN/4/1?curriculum_id=4f89dab3d788890003000096#

This is what my code looks like vv

print "What is one plus one?"
def the_flying_circus(answer):2
if answer == 2:
return True
elif answer != 2:
return False
else:
print "Wait what!?"

I am sure all my indents are good, but it still keeps saying that the return is outside the function. Thanks in advance!


#2

this is currently your function + content:

def the_flying_circus(answer):2

shouldn't the if, elif and else also be part of the function content?


#3

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