The Big If


#1



The Big IF


I have not altered the indentations at all, the if statement begins a tab away from the def statement and the return statement begins a tab away from the if statement, but I keep getting indent errors when I submit the code.


I expect it should work but it doesn't.


# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if 5<10 and 4<8:    # Start coding here!
        Return True # Don't forget to indent
        # the code inside this block!
    elif 5<2 :
        Return False # Keep going here.
        # You'll want to add the else statement, too!
    else :
        Return Purple


#2

Don't capitalize "return" and Purple should have quotes around it as it is suppose to be a string.


#3

Ohhhh so I had to have return be all lowercase in order for it to be recognized... thanks. But can you explain to me why purple needed quotes? Because it's a string? What was it without the quotes?


#4

Well without quotes...it was nothing, as it isn't predefined in Python. The reason you don't have to do that for True and False is because they are booleans, and are predefined in Python, meaning Python recognizes them and knows what they mean.


#5

Ohh ok ok I gotcha. Thanks so much for the clarification


#6

Welcome. :slight_smile:


#7

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