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 trialChristian A. Castro
30,501 PointsExiting Challenge: Any suggestions?
import sys
movie = input("Start the movie?")
if movie != 'n' or 'N':
print("Enjoy the show!")
else:
sys.exit()
import sys
movie = input("Start the movie?")
if movie != 'n' or 'N':
print("Enjoy the show!")
else:
sys.exit()
1 Answer
jonlunsford
16,746 PointsThe code challenge is looking for an exit using the sys module. You have sys.exit() in the 'else' case, but you need to add one in the if movie != ... case also. For instance...
if movie != 'n' or 'N' :
print("Enjoy the show!")
sys.exit()
else:
sys.exit()
Christian A. Castro
30,501 Pointsjonlunsford Thank you for your quick response! I didn't know that I needed to use the sys.exit method on the if statement as well.
Omar Abu Hamdan
794 PointsOmar Abu Hamdan
794 Pointsyou just have to use "and" instead of "or"