Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Letter Game App Exiting

Nicholas Gaerlan
Nicholas Gaerlan
9,501 Points

Why won't the text accept this answer?

I've tested the code and it produces the correct response. I also tried a tried a variant where the 'if' was closer to the instructions

if answer == 'n' or answer == 'N': sys.exit() else: print("Enjoy the show!")

do I need to setup an elif not answer.isalpha() to handle non-text input?

firedoor.py
import sys

def start_movie():
    answer = input("start movie Y/n").lower()
    if answer != 'n':
        print("Enjoy the show!")
    else:
        sys.exit()

2 Answers

Nicholas Gaerlan
Nicholas Gaerlan
9,501 Points

that's how I started this quiz. at some point it threw an error the wrong result from some function called "start_movie" so i'm guessing that's working in the back ground. The thing that originally got me turned out to be indenting the "if" block, but I stripped it out of the function and de-dented the "if" to inline w/ the answer variable and it worked. Thanks!