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

Is the issue in my import sys?

I believe my code is improper due to an improper usage of import sys. Could someone guide me to the answer with out actually giving me the answer?

firedoor.py
import sys

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

First there's a logic error in your conditional statement when evaluating whether or not to start the movie. Right now if someone sends in an "N"... what's going to happen? Your code says if the start_movie is not equal to "n" (which is now true because it's "N") it stops evaluating right there. Only one thing in an or statement has to be true for the code to run. If you want both to be true for the code to run you need to not use "or". You need to use _ _ _ .

Secondly, your sys.exit() is written correctly but there's an indentation problem. It should line up with the print statement :) Hope these hints were enough. Happy coding!