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

'admitted' is not False.

task one seems to pass, task 2 isn't :/ thanks in advance for the help.

conditions.py
admitted = None
if age >= 13:
  admitted = "true"
else:
  admitted = "false"

[MOD: fixed formatting -cf]

2 Answers

Kevin Faust
Kevin Faust
15,353 Points

I dont know how you passed task 1 as your supposed to assign a boolean NOT a string. So True and False

admitted = None
if age >= 13:
  admitted = True
else:
  admitted = False

Thanks, it's odd though, my first answer wasn't a string, and it still didn't work then. the only difference this time was that i capitalised the T and F in true/false and it worked.

Kevin Faust
Kevin Faust
15,353 Points

Yea keep in mind that unlike other programming languages, python needs its booleans capitalized

Abraham Juliot
Abraham Juliot
47,353 Points

"This is correct answer" also works for task 1. Actually, any numeric value, string value, or object is True, except None, False, 0, ' ', ( ), [ ], { }.

Joyful coding to you :)

Thanks Abraham :)