Did I forget to add a return statement?


#1

Hi, I just wanna know what I`m doing wrong...
def the_flying_circus():
if (4==4):
print 4==4
# Start coding here!
# Don't forget to indent
# the code inside this block!
elif 3==(2+1) or 4==4:
print True
# Keep going here.
# You'll want to add the else statement, too!
else:
print 8==8

This keep me saying that maybe I forget to add a return statement.


#2

your function should return True


#6

what does that mean? how do you write that into the code?


#7

It means the exercise expect the function to behave in a certain way

return True is code?


#8

the fact that codecademy code has to be so spot on with what they declare is weird in my opinion, its limits you from writing your own code...and learning as a beginner

def the_flying_circus():
if 100 > 1 and 8 * 375 * (-8 + 2 ) == 1: # Start coding here!
return "uhh oh"
# the code inside this block!
elif answer != "the_flying_circus":
return True
else:
return 'll want to add the else statement, too!'

I'm guessing they want it to return True, instead of print, even though their photo shows "print"

coding takes countless dedicated hours, I love it... but the whole not functions through me for a loop


#9

I was having the same problem trying to get the program to recognize my return statement. It turned out the "T" in "True" just needed to be capitalized.


#10

Thanks for your advises. I have stuck here, Now I got the right answer.


#11

I spelled True with capitalized T in my first answer in this topic? I did this with a reason, Boolean values start with uppercase first letter in python


#12

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