The Big If - I am missing something fundamental


#1

This is my newest code, and it won't work. The others have been more complicated than this, needless to say they don't work either.

HELP, please

def the_flying_circus():
if the_flying_circus == 1 or the_flying_circus == 0:
print True
elif the_flying_circus != 1 or the_flying_circus != 0:
print False
else:
print True


#2

It is saying I don't have a return statement and I don't know how they figure that.


#3

It seems like you're using the_flying_circus a lot before you define it. The code should look something like this:

def the_flying_circus():
if 10 == 10 and 10 ** 2 == 1000: # Start coding here!
print False
# the code inside this block!
elif 32 * 8 == 14 and 77 * 44 == 11:
print False
else:
return True


#4

Make sure that the_flying_circus() returns True

def the_flying_circus():
if 10 == 10 and 10**2 == 1000: # Start coding here!
print False
# the code inside this block!
elif 32 * 8 == 14 and 77 * 44 == 11:
print False
else:
return True

I tried this exact code and I get a syntax error in Line 8 (else:). I can't figure out why. I am sure it's something simple I am doing wrong.


#5

def the_flying_circus():
if 10 == 10 and 3 < 4:
print "Es verdad"
return True
elif 12 == 13 and 4 > 5:
print "Mentira"
return False
else:
print "Ya no se que poner"
return True

the_flying_circus()

use this :slightly_smiling:


#6

I get an error saying invalid syntax in Line 9 (else:)

Make sure that the_flying_circus() returns True

def the_flying_circus():
if 10 == 10 and 3 >4: # Start coding here!
print "Es verdad"
return True # the code inside this block!
elif 12 == 13 and 4 > 5:
print "Mentira"
return False
else:
print "ya no se que poner"
return True


#7

Never mind. I had to indent "else" to fix the problem.


#8

it is so hard if i get the code i will tell you


#9

def the_flying_circus():
if 9 <= 9: # Start coding here!

Don't forget to indent

the code inside this block!

elif 6 == 8 or 99 < 88:
return False

Keep going here.

You'll want to add the else statement, too!

else:
return False
Outcome:
File "python", line 6
elif 6 == 8 or 99 < 88: