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 trialAdam Siwiec
12,070 PointsTested the code, and it works. Keep getting a challenge error "Try Again"
Keep getting the try again error on Python basics challenge question.
import sys
inputs = input("test ")
if inputs != "n" and inputs != "N":
print ("Enjoy the show!")
else:
sys.exit(0)
2 Answers
Silviu Popovici
20,433 PointsTaking the 0 out of sys.exit(0) worked for me
Sarah Dwyer
2,060 Points- it should be an if-or statement, not if-and ---> if ans =='n' or ans =='N':
- within the if statement place sys.exit() & within the else statement print("Enjoy the show!)
- remove the space between the print statement and the parenthesis
- remove the zero from sys.exit()
Jeremy Hill
29,567 PointsJeremy Hill
29,567 PointsSometimes the challenge is looking for a specific output or specific syntax; even though the code may work it might not be what the challenge is looking for.