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!
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
Andrew Morgan577 Points
Didn't get an exit from 'start_movie'
I'm not sure why this isn't getting an exit on the firedoor.py challenge. I originally tried this:
import sys start_movie = input("Would you like to start the movie? Y/N: ").lower() if start_movie.lower() != 'n': print("Enjoy the show!") else: sys.exit
In the end, I solved by adding parentheses after sys.exit, like so:
import sys start_movie = input("Would you like to start the movie? Y/N: ").lower() if start_movie.lower() != 'n': print("Enjoy the show!") else: sys.exit()
But in the hangman exercise we just completed before this, Kenneth had used the following:
def welcome(): start = input("Press ENTER to start or Q to quit: ").lower() if start == 'q': print("Bye!") sys.exit else: return True
Why is his use of 'sys.exit' working without the parentheses and mine wasn't? Not sure I'm 100% grasping that concept.