The Big If


#1

When I click "Save & Submit Code" the warning sign says this: the_flying_circus() should return True, instead it returned: 'True'

Make sure that the_flying_circus() returns True

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


#2

True shouldn't be in quotes, and not true doesn't exist. It is false.


#3

Indeed indeed, precisely don't do # Do Something - as Something != 'anything'. They want a particular something to be returned


#4

"""This is my code and works
Try my code and modify it. If you have a problem let me know."""

def the_flying_circus():

if (64 >= 18 and 54 < 21):
    print "Esta condicion es falsa"
    return False

elif (7 > 21 or 9 > (4+4)):
    print "Esta condicion es verdadera"
    return True

else:
    return False

print the_flying_circus()

:hamburger::tongue:


#5

def the_flying_circus():
if (64 > 18 and 54 < 21):
print "This mike dosn't work"
return False

elif (7 > 21 or 9 > (4+4)):
print "Testing 1 2"
return True

else:
return False
print the_flying_circus()

This is what i put in the code thing, and it keeps saying Oops, try again. An exception was raised while running your code, see the console window for the error message on line 2. What is going on ?????????


#6

@tomkrys13

I was running into the same problem. You don't want it to print anything other than True so remove print after any of the conditions. Then ask it to print at the very end...

def the_flying_circus():
if (64 > 10 and 11 > 55):
return True
elif (64 > 10 or 55 > 10):
return True
else:
return False

print the_flying_circus()


#7

I was stuck for awhile on it also but was able to figure it out. This is what I wrote:

Make sure that the_flying_circus() returns True

def the_flying_circus():
if (6 > 5 and 5 == 5): # Start coding here!
return True
print "It is correct."
elif (5 <= 1 and 6 == 5):
return False
print "This is incorrect."
else:
return True
print "the_flying_circus()"


#8

There is my correct answer:

def the_flying_circus():
if 4==4 and 5!=4:
print "Es verdad"
return True
elif 6>5 or 10==10:
print "Esto es una mentira"
return False
else:
return True
print the_flying_circus()


#9

It didn't work. I am at this one since last year. And I think I am going to give up with python, because I am losing time on this. I just want to pass.


#11

Usually indentation.


#12

Strange, I wrote it line for line directly into a python interpreter and it returned True.


#13

You use chrome or firefox ?


#14

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

This works!
If you find you cannot continue or do not know what to write. Just go back and review!


#15

Another working option for this exercise.

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