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.

Daffa Alif Pratama
2,316 PointsWhat am I doing wrong in this code?
import sys
option = input("Play movie?") if option == "n" or "N": sys.exit()
else: print("Enjoy the show!")
import sys
option = input("Play movie?")
if option == "n" or "N":
sys.exit()
else:
print("Enjoy the show!")
1 Answer

Steven Parker
215,939 PointsLooks like you have a couple of issues:
- Indentation is critically important in Python. For example, an else must line up with the corresponding if
- When testing for more than one condition, you must use logical operators to combine individual tests
- You can also use a case conversion function if you want to make a string comparison case-insensitive
I'll bet you can get it now, but if not... <button' onclick='$("#spoiler").slideDown("slow");$(this).remove()'>Press to Reveal Spoiler</button> <div id='spoiler' style='display:none'>
SPOILER ALERT
import sys
option = input("Play movie?").lower()
if option == "n":
sys.exit()
else:
print("Enjoy the show!")
</div>
Daffa Alif Pratama
2,316 PointsDaffa Alif Pratama
2,316 PointsTHANKSS!
Grigorij Schleifer
10,363 PointsGrigorij Schleifer
10,363 PointsThis SPOILER effect is AMAZING !!! Steven could you share us how to markdown this please???