The Big If


Can someone help with writing the code ?


The error message says that on line four, it expected you to indent False and False. I would do that and see what else is wrong.


hey i try a new way to do it but then shows me another error


Read the error message, on line ten, it points to the colon at the end being your problem. You don't want the colon after you call the function.


These are the exercise instructions,

Write an if statement in the_flying_circus(). It must include:

if, elif, and else statements;
At least one of and, or, or not;
A comparator (==, !=, <, <=, >, or >=);
Finally, the_flying_circus() must return True when evaluated.
Don't forget to include a : after your if statements!

Take a look at your code and see if it does all that is needed to pass the SCT I would start be using booleans and not strings. :slight_smile:

And you cannot print a function before declaring that specific function as you are trying to do on line 10


also @kyleaw You forgot to mention that he is putting strings. What is he needs to do is make the vaules return to true and only the system will read the elif if the first code where you return is false and you make the problem false then make the second problem true.


Remember that the boolean values are True and False. These are case-sensitive names, so the value to return in this exercise is True.


They know what I mean, I think he's smart enough to know. # Make sure that the_flying_circus() returns True
def the_flying_circus():
if 3 > 4 and 4 == 3:
return False # Don't forget to indent
# the code inside this block!
elif 31==31 and 31>=29:
return True

else : # Keep going here.
  print the_flying_circus()


I know what you meant by saying that he is not only wrong in the syntax area, and I agree. The only reason that is the only problem I mentioned because I want to point out the most obvious answers and teach them syntax before I attempt to identify the rest of the problem. :slight_smile:


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