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 trialChristopher Morris
1,050 PointsI need you to make an if condition that sets admitted to True if age is 13 or more. I dont understand whats wrong...
im not sure what I am doing incorrectly... I may be misunderstanding the question...
admitted = None
if admitted >= 13:
print(True)
2 Answers
Stuart Wright
41,120 PointsThe name of the variable you are checking in the condition should be 'age', not 'admitted'.
You don't need to print True, you just need to assign it to the 'admitted' variable.
admitted = None
if age >= 13:
admitted = True
Steven Parker
231,275 PointsHere's a couple of hints, if you'd like to try resolving it without a spoiler:
- you need to test the value of age, not admitted
- if the condition passes, you should assign the value True to admitted
- you don't need to print anything