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

why 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? :smile:

1 Answer

okay :smile:

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

As 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