Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (2015) Letter Game App Exiting

I tried this out in the console and it works fine?

I'd love to know what I did wrong? I did everything in the instructions and I also put it into workspaces and it worked like a charm.

Do you know the problem?

import sys

def start_movie():
    user = input("Do you want to start the movie? Y/n ")
    if user != 'n'.lower():
        print("Enjoy the show!")


2 Answers

Stuart Wright
Stuart Wright
41,118 Points

You have the right idea, but your logic isn't quite correct:

if user != 'n'.lower():

'n'.lower() is just 'n', always. And we're not translating the user variable to lowercase. So if I input 'N', it will say "Enjoy the show!". To fix this, you need to use the .lower() method on user, rather than 'n'.

I felt so stupid when I saw the mistake haha. I'll be sure to be careful with the logic next time!

You need to call .lower() on user, not on 'n'.

Haha, thanks for this comment! I literally just figured that out a couple of seconds before you posted this haha.