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 trialRaiyan Ahmad
3,622 Pointswhats wrong
?
n = input('dou you want to watch a movie?')
if n != 'n' or'N':
print('Enjoy the show! ')
else:
sys.exit()
2 Answers
Miles Aylward
13,225 PointsYour code is correct for the most part just a few minor things. you can't use or there because you have to test to ensure that it isn't 'n' and it isn't 'N' so you need to use the 'AND' keyword. And you must restate the variable for the second comparison operator.
if n != 'n' and n != 'N':
Thomas Fildes
22,687 PointsHi Raiyan,
Please see my code below which I used to pass this challenge:
import sys
question = input("Do you want to start the movie?")
if question != "n" and question != "N":
print("Enjoy the show!")
else:
sys.exit()
Everything in your code looks good apart from the "or" you used after your first condition in the if statement. You are to use "and" in replacement of this and it should work.
Hope this helps! Happy coding!!!
Raiyan Ahmad
3,622 PointsRaiyan Ahmad
3,622 Pointsok thanks!