The big if


#1

I think I'm stuck on the Elif statement. Help pleeease

    if the_flying_circus == 17 :
        print "True" 
        
    elif the_flying_circus != 100 and == 99 :
        print "Wrong flying circus"
        
    else:
            
        print "Go back to earth's circus!"


#2

When you use and you have to be very explicit so you have to repeat the entire condition so
elif the_flying_circus != 100 and the_flying_circus == 99:


#3

Thank you. I imputed the following updated code but it is saying that the_flying_circus() returned the value None and asked if I forget to add a return statement? Any clues on where I am supposed to add this return statement?

`
def the_flying_circus():
if the_flying_circus == 17 :
print "True"

elif the_flying_circus != 100 and the_flying_circus == 99 :
    print "Wrong flying circus"

else:
    print "Go back to Flower Power on earth!"

    ```

#4

In functions it is generally best to return a value instead of printing. In this case that is what they are looking for.


#5

Thank you!! I managed to get the right answer :slight_smile:


#6

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