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

Jillian S. Estrella (she/her)
Jillian S. Estrella (she/her)
15,720 Points

Exiting

I have tried to approach this question multiple ways. Here is one iteration:

import sys

start_movie = input("Would you like to start the movie? ")

if start_movie.lower != "n": print("Enjoy the show!") else: sys.exit()

Seems that no matter what I try, I get the following error message "Couldn't get an exit from 'start_movie'".

2 Answers

Ryan S
Ryan S
27,276 Points

Hi Jonathan,

It'd be helpful if you provided a link to the challenge you are working on so we know what the objective is.

One thing I notice is that you are missing the parentheses on your .lower() function.

Good luck.

Jillian S. Estrella (she/her)
Jillian S. Estrella (she/her)
15,720 Points

Oh my bad. It's the "Python Basics" course, the title of the exercise is "Exiting".

Derp. Thanks for catching the .lower(). That fixed the problem.