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 trial

Python Python Basics (2015) Logic in Python Conditional Value

masanari suzuki
masanari suzuki
6,883 Points

Python Basics Task 2 of 2

For task 2 of the challenge, every time 'admitted ' is not False.what shoud i do.

3 Answers

admitted = 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.

I 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!

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

Be 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.

You 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.