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! While you're at it, check out some resources Treehouse students have shared here.

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

Abdullah Jassim
Abdullah Jassim
4,551 Points

i dont know whats wrong

python

import sys

variable = input("Do you want to start the movie? ")
if variable != 'n' or variable != 'N':
    print("Enjoy the show!"
else:
    sys.exit()
firedoor.py
import sys

variable = input("Do you want to start the movie? ")
if variable != 'n' or variable != 'N':
    print("Enjoy the show!"
else:
    sys.exit()

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

There are 2 problems that I see. First, the print statement is missing a close paren. After that, the condition will currently pass if variable != "n" or variable != "N". This will be true every time. In this case, you want the condition to only pass if the input is neither an uppercase nor a lowercase "N". In other words, you want it to pass when variable != "n" and variable != "N". Once these 2 problems are fixed, I believe this code will pass the challenge