Trying to make "The Big If" bigger but failed! help please!


#1



I was trying to make The Big If a tiny bit more interactive. But ended up not getting stuff printed.

https://www.codecademy.com/en/courses/python-beginner-BxUFN/4/1?curriculum_id=4f89dab3d788890003000096#


I have no errors.


As we can see, I am using raw_input() to ask a question "do you like to code?", give an opinion and the code is meant to react to the words yes, unsure or no. It was meant to react by RETURNing false (what the task requests me to do) and then to PRINT a sentence (see my code). The problem is that the boolean True or False was returned, but the sentence didn't get printed. I tried changing PRINT to RETURN but it did not work either.
I think that there is something to do with the syntax of IF STATEMENTS. So can someone tell me how to make the boolean and the sentence appear.


opinion = raw_input("Do you like to code? (yes, no, unsure)")
# Make sure that the_flying_circus() returns True
def the_flying_circus():
    if (8 <= 9) and (opinion == "yes"):    # Start coding here!
        # Don't forget to indent
        # the code inside this block!
        return True  
        print "Lets go!"
    elif (8 == 9) or (opinion == "unsure"):
        # Keep going here.
        # You'll want to add the else statement, too!
        return True
        print "Well you will in future!"
    else:
        return False
        print "Don't worry, you might in future!"
print the_flying_circus()


#2

Your code stops running at the return statements, so it doesn't even see the print statements. For the if statement, changing it to or worked for me:

https://goo.gl/xKxAzr


#3

You may also consider adding another option just in case they enter something is not yes, no, or unsure. You could also set the opinion variable to lowercase that way you don't have to worry about the code not knowing the difference between YES and yes.


#4

Please your code did not work for me.


#5

The code discussed here is not a solution to the lesson. It is a bit of code the original poster was testing. If you need assistance with your code, feel free to open up another thread and one of the many helpful people here will be happy to help you out.


#6

Thanks for that.Problem solved.


#7

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