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 trialMarko Borenovic
1,813 PointsWhere did I done wrong
I don't know where I made a mistake??
import sys
start_movie = input("Do you want to start the movie")
if start_movie != "n" or "N":
print("Enjoy the show")
else:
sys.exit()
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi Marko,
You are definitely on the right track. There are just a couple of small error with your logic for the conditional check.
First, when checking more than one condition, each condition needs to be checked against the variable. So you can't have
if variable == condition1 or condition2
Although you are checking in one line, they still need to be their own like this
if variable == condition1 or variable == condition2
Notice how each condition is separately checked against the variable.
Second, the conditional logic is not correct. You are using or
which means only one of the conditions need to be met to return True
. So, if the user enters "N", that does not equal "n", but it will still return True
.
With the logical operator and
, both conditions need to be met to return True
. So, now if the user enters "N", it will still return False
if "n" is entered, because only one condition was met.
Everything else... you're doing great. You are using the negation correctly and the rest of the syntax is correct. Once you correct those two things, it'll all pass!
Keep Coding! :)
Marko Borenovic
1,813 PointsMarko Borenovic
1,813 PointsThank you for the information :)