The big If


#1



I'm trying to get my code to work. It keeps coming back incorrect. How and why is "4" a syntax error?!

my statements returning true


# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 10>5 or 5>4
        return: True   # Start coding here!
        # Don't forget to indent
        # the code inside this block!
    elif 10 != 10
        return:False
    
.


#2

No need of colon after return ,also makes changes in elif part!

You need to use colon after if,elif and else..

if 10>5 or 5>4

Syntax..

if condition:
    #yourcode 
elif condition:
    #yourcode
else:
    #yourcode

#3

I tried that and now it's saying 10 is a syntax

def the_flying_circus():
if 10>5 or 5>4:
return True # Start coding here!
# Don't forget to indent
# the code inside this block!
elif 10 != 10
return False


#4

@atronix47
You need a colon after elif statement!
look at the syntax..

if condition:
    #yourcode 
elif condition:
    #yourcode
else:
    #yourcode

#6

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