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

aroshinemunasinghe
5,649 Pointswhy true when you call bool() from 1..
I understood when you type in python shell bool(0) it returns False but when you type bool(1) or bool(100) it returns True why is that?
Shall I think in logic way that zero means nothing and thats why it returns False?..or?
1 Answer

Jennifer Nordell
Treehouse TeacherBecause 0 is a "falsey" value. Any non zero number is a "truthy" value
aroshinemunasinghe
5,649 Pointsaroshinemunasinghe
5,649 Pointsokay
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherAs an additional note, I can't seem to find any truthy/falsey documentation for Python 3. But to my knowledge, it hasn't changed from Python 2. You can see some documentation here about what classifies as "falsey" in Python.
https://docs.python.org/2.4/lib/truth.html