How do I get this If statement condition to work properly?

I’m having a problem with the following piece of code:

decision = str(input("Would you like to change it?:"))
if decision.lower == 'yes':
    new_holiday = input("What is your new favorite holiday?:")

The problem with this is that when I input ‘yes’ in the first prompt, instead of showing me the second one as I want, it just skips the if statement completely. Am I missing something here?

>Solution :

decision.lower generates a method <built-in method lower of str object at ...>. you should call decision.lower().

Change your code to the following:

decision = str(input("Would you like to change it?:"))
if decision.lower() == 'yes':
    new_holiday = input("What is your new favorite holiday?:")

Leave a Reply