Oct-04-2019, 06:15 AM
(Oct-04-2019, 05:55 AM)buran Wrote:Another little bit that I've just learned!!! Thank you!(Oct-04-2019, 04:34 AM)newbieAuggie2019 Wrote: 0, 0.0, and "" (the empty string) are considered 'False', while all other values are considered 'True'Technically the second part of this statement (my bold) is not 100% true -None
and empty sequences and container types like list, tuple, dict, etc. are also evaluated False
https://docs.python.org/3/library/stdtypes.html#truth
It makes sense, as it seems to me that
None
, empty sequences and other empty container types like list, tuple, dict, etc. give me the same linguistic feeling as '0', '0.0' or an empty string.All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs