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 trialNicholas Gaerlan
9,501 PointsWhy 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?
import sys
def start_movie():
answer = input("start movie Y/n").lower()
if answer != 'n':
print("Enjoy the show!")
else:
sys.exit()
2 Answers
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 PointsHi Nicholas! You need to take it out of the function as the challenge isn't asking for that and I think it will mark it incorrect.
Hope that helps! :)
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 PointsGlad you figured it out! :)
Nicholas Gaerlan
9,501 PointsNicholas Gaerlan
9,501 Pointsthat'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!