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

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!