Don't understand the instructions


#1

Make sure that the_flying_circus() returns True

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

Oops, try again. An exception was raised while running your code, see the console window for the error message.

File "python", line 6
elif 1==1 or 1>1:
^
IndentationError: expected an indented block


#2

What you are required to do in that exercise is set your conditional statements in such a way that when you call your function the value returned to the console is True :slight_smile:


#3

Read the error code. What does it say?

In one of the comments in your code, it also says:


#4

please explain.......


#5

still don't understand


#6

In python any code after a colon must be indented so I hope in your editor your code is indented like this,

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

this will fix the indentation error,
However your code will still be incomplete. No code in the if block, elif block, no else statement (optional, but advised), and no function call.

Additional Note: Comments do not follow the conventional indentation rules. but it is advised that you indent them to the same indentation level as the line they refer to


#7

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