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

Can't pass this test.

''' import sys q = input("do you want to start a movie?".lower) if (q != "n"): print("Enjoy the show!") else: sys.exit() '''

Whats is wrong with this code? It works just fine in compiler. wow I can't even format it in right way...

To format your code properly, you shouldn't use this symbol: '

:point_right: You should use this symbol: `

You can find the backtick symbol (`) on the very top-left corner of your keyboard, usually. It is also very commonly under the esc key on your keyboard.

2 Answers

Without you formatting your code properly, it is hard to tell where your errors are.

However, there are a couple errors in plain sight even without formatting:

  • You need parentheses () after lower. This is because it is a function.
  • You need to move the use of the lower function outside the input function call.
  • You need to CAPITALIZE the very first letter of "do you want to start a movie?".

I'm pretty sure this would work:

import sys

watch_movie = input("Do you want to start a movie? ").lower()

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

Thanks guys! That was very helpfull! :)