The big if


#1

https://www.codecademy.com/courses/python-beginner-BxUFN/4/1?curriculum_id=4f89dab3d788890003000096#

I'm told that line 8, my else statement has invalid syntax. Why is it saying that when it looks correct?


# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 3!=4:    
        print "The Flying Circus isn%t a myth!" 
    elif 3==4:
       True or False (3<4)
    print "The Flying Circus is a myth!" 
    else:
        print "The Flying Circus doesn%t exist."


#2

The problem is actually in the line above:

print "The Flying Circus is a myth!"

this line is not inside the elif, and else needs to be after elif. So i would indent that line correctly.

This solves your current problem, you will get a new error message (the right thing is not returned), if you need help with that as well, make a reply with your updated code + error message. Good luck!


#3

or is it..............:triumph:


#4

Yes, it is. It solves the current error message


#6

I was hoping you would see that. Okay, now the indention in this two lines is not matching:

       True or False (3<4)
        print "The Flying Circus is a myth!"

you should insert an additional space before True, to match the print statement on the line below


#7

No I understood it and I'm now at the part that you said I might need help on. I removed my previous comment but not in time.


#8

Agree, you could ask for more help, i said so. And i kept my promise, now the indent error is gone, do you need more help or can you manage it from here?


#9

I re-posted my code when I got the error you said I'd get and someone else told me that I needed to put "return" and "true" on the same line. I'm past this part now.


#10

Now you lost me, i don't see any returns anywhere. If you need more help, post an updated version of your code + error message.


#11

I re-posted my code after I fixed that line about my else statement. I then added the "return true" to the if, elif, and else statements to my code in my new topic. But the point I'm trying to make is that my code works now. Thanks to you and another guy who responded on my other topic


#12

Well, i didn't you made a whole new topic, with repost your code i just meant a reply in this existing topic. cadecodes is good, good to hear he resolved your issue


#13

Oh... I didn't realize you meant that re-post my code meant to reply to you. Anyways, thank you both for your help.


#14

I can't watch all the topics, but good to hear the issue is resolved :slightly_smiling: