The Big IF


#1

Make sure that the_flying_circus() returns True

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

print the_flying_circus(True)
print the_flying_circus(False)
I keep getting
Oops, try again. the_flying_circus should not take any arguments.


#2

the_flying_circus shouldn't have any parameters, so get rid of answer. Whatever variables you play around with should be defined within the function, and then you'll call:

the_flying_cirus()

If it returns True you'll pass the course.


#3

What do you mean can you give the correct answer in order to pass this part of code academy "the Big IF" so that I don't get the "Oops try again" message at the bottom of the screen and I can try and get it first time and move on in order to complete this part of Code Academy Python without getting that Syntax Error.

Reply to this answer as quick as you can.

Thanks.


#4

Is the correct answer but if the syntax error you must have put up the wrong answer on here.

Please add the correct answer to the QA Forum

Thanks. Reply as quick as you can.


#5

It looks complex but really, it's not at all.

Here, look at my code (Which works fine) and see if you understand it:

def the_flying_circus():
    if "Alpha" and "Bravo" == 2:
        return "1st line is true!"
    elif 1 > 2:
        return "2nd line is true!"
    else:
        return True

Hopefully this helps :smile:


#6

Thanks! I works great!
I don´t know why this works, so, I´ll start the lesson again :slight_smile:


#9

It WORKS! why>?? im so confused but thanks im 13 so i dont understand most.


#10

thanks mate needed some help with this :slight_smile:


#11

def the_flying_circus():
if (answer) <6:
return True
elif (answer)>6:
return False
else:
return "6"
print the_flying_circus(5)

I did this, yet the prompt is telling me it is answering FALSE. HOW!!!!


#12

The following are my successful codes:

Make sure that the_flying_circus() returns True

def the_flying_circus():
if (2-2 == 0) and (0/1 == 0):
return True # Start coding here!
# Don't forget to indent
# the code inside this block!
elif (1 <= 0) or ( 2**2 == 0):
return False
else:
return True
# Keep going here.
# You'll want to add the else statement, too!
Explanation:
1) If: Make sure you provide conditions which are true to return True.
2) ElIf: Similarly provide conditions which are false to return False.
3) Else: return True. This is to ensure it return True.