The Big If elif is an invalid syntax


#1
# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if True: 4<5   # Start coding here!
    print 'True'# Don't forget to indent
        # the code inside this block!
    elif False
        print 'False'# Keep going here.
        # You'll want to add the else statement, too!
    else:    
        print 'Not true not False'

#2

It says invalid syntax becasuse your code is syntactically invalid.

You can't write if True: 4<5. That's not proper. It would need to be something such as if 4 < 5:, which suffices for True since 4 < 5 is True.

Does that make sense?

Secondly, elif False is invalid because, one, it has no : to start the condition block and, two, it has no condition other than False which would cause it to never fire, ever.

Make sense?


#3

Ohh ok Thanks for the help but this message popped up
Oops, try again. the_flying_circus() returned the value None, did you forget to add a return statement?

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 4 < 5 :
      print True # Don't forget to indent
        # the code inside this block!
    elif 4 > 5:
        print 'False'# Keep going here.
        # You'll want to add the else statement, too!
    else:    
        print 'Not true not False'

What did i do wrong?


#4

Without the exercise instructions, I'm going out on a limb here however you may find it advantageous to replace print True and print 'False' with return True and return False respectively.