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 trialErik Luo
3,810 PointsDidn't get an exit from `start_movie`. Why?
Didn't get an exit from start_movie
. Why?
import sys
start_movie = input("Start the movie? Y/n ")
if start_movie != "n":
print("Enjoy the show!")
else:
sys.exit()
2 Answers
Name:GoogleSearch orJonathan Sum
5,039 PointsHi, Erik Luo. You are doing great. You are just missing the last 1 % of it. You also need to set it if the start_movie equals to N ,you need to call out the sys.exit().
let me get you a hint first.
Answer=("You are a newbit?type Y or y").lower()
#Whether upper case Y or lower case y you type ,the var "Answer" always equals to lower case y that line of code is using a lower case function".lower()".
Modou Sawo
13,141 PointsHi Erik!
Since it says, if the input the user gives is anything other than "n" or "N" to print "Enjoy the show", try:
if start_movie == "n" or start_movie == "N":
sys.exit()
```
Then use the else to print the string "Enjoy......"
Erik Luo
3,810 PointsErik Luo
3,810 PointsThank you