The Big If


#1





I'm stuck, can you help me?
This is the error message:
File "python", line 12
elif:
^
IndentationError: unindent does not match any outer indentation level

Thank you!


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


#2

First things first, else is always the last thing in your if statement. You have elif last. The order is if, then however many elifs you want, and then 1 else last. The else has no conditions so it just runs if nothing else is true. You are getting the error because your elif is 1 space to far to the left. Inside a function everything is exactly 1 tab to the right. And in an if statement everything is another tab to the right. Hope this helped! :smiley:


#3

im also stuck in this part. The message its:

File "python", line 10
print the_flying_circus()
^
IndentationError: unindent does not match any outer indentation level

this is what i did:

Make sure that the_flying_circus() returns True

def the_flying_circus():
if the_flying_circus>150: # Start coding here!
print "sjame"

elif (the_flying_circus<120) and  (the_flying_circus>100):
    print False # Keep going here.
else:
        print True # You'll want to add the else statement, too!

print the_flying_circus()
return "nicely done, good number"


#4

Hello!

I just have a question, I get this message which I cannot understand well.

It says "the_flying_circus should not take any arguments"

And the code goes like this

Make sure that the_flying_circus() returns True

def the_flying_circus (answer):
if answer < 101: # Start coding here!
return True # Don't forget to indent
# the code inside this block!
elif answer > 101:
return False # Keep going here.
else: # You'll want to add the else statement, too!
return False

print the_flying_circus_101(90)
print the_flying_circus_101(101)
print the_flying_circus_101(201)


#5

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