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 trialmasanari suzuki
6,883 PointsPython Basics Task 2 of 2
For task 2 of the challenge, every time 'admitted ' is not False.what shoud i do.
3 Answers
Charles Ratkie
11,607 Pointsadmitted = None
if age >= 13:
admitted = True
else:
admitted = False
Since Kenneth is creating the 'age' variable for us, we just need to add an if/else conditional.
Chris Freeman
Treehouse Moderator 68,441 PointsBe sure that you are not assigning age
to a value in your code. The grader will set age
to various values when testing your code.
mkmk
15,897 PointsYou must set admitted to the proper boolean values on each branch of your if / else statement.
At the end of task 2, admitted will have had three values set in the code, total.
Patrick Akera
492 PointsPatrick Akera
492 PointsI made the stupid mistake of changing the value of the variable "admitted" to the number 13. and then proceeded with - if age >= 13: print("true"). some reason it worked and i passed task 1 :/ . but, this cleared the whole thing up, thanks!