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 trialMusheer Ahmad
345 PointsNot recognizing code.
It seems the system is not able to recognize my code.
admitted = None
if admitted != age:
admitted = True
else:
print("Hi")
1 Answer
Julio Sanchez
14,289 PointsHi there, the below code worked for me. It seems that you're not comparing age to 13, so the if statement has nothing to return. Then, I'm not sure why you have it printing "Hi". When I looked at the challenge it said the else: statement to evaluate to False. Good luck!
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherHi Julio! I took the liberty of changing your comment to an answer. This marks the answer as answered in the forums and also allows for voting on your answer and possible assignment of "Best Answer". Thanks for helping out in the Community!
Darren Taylor
1,052 PointsDarren Taylor
1,052 PointsJulio, thanks for your help, your example worked for me too!