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 trialtraolach trewhella
Courses Plus Student 835 PointsI DID THIS RIGHT STILL DIDINT WORK ANSWERS
CORRECT ME IF IM WRONG
admitted = None
if age >= 13:
admitted = True;
else:
admitted = False;
2 Answers
Matt Nickele
468 PointsThe else should be equal with the if and no semi-colons
Fable Turas
9,405 PointsThere are 3 things that I see here.
The first 2 are minor things that strictly speaking won't effect your outcome, but are important to note when writing good Python.
The first: Python doesn't use semi-colons to close out lines.
The second: You do not need an 'else' statement to fulfill the request of the challenge since you already have a value for 'admitted' that is Falsey, so you only need to change it to True when the True condition is met. If the condition isn't met it will stay set to the Falsey value and 'admitted' will evaluate to False in any subsequent condition without you writing the extra lines to set an explicit 'else'.
The third thing I see is most likely the reason your code is not passing though. Python is a white space based language. Your tabs are important. If you over or under tab, your code will break.