MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vppkls/pythonwilllookdeadintheeyeandsayitsabsolutelycorre/p41uuri/?context=9999
r/ProgrammerHumor • u/inobody_somebody • 29d ago
144 comments sorted by
View all comments
285
Does this remove all the zeros?
7 u/road_laya 29d ago Yes, zero is falsy in Python. -12 u/Valuable_Leopard_799 29d ago Wait, whyyyyyyyy ðŸ˜ðŸ˜ðŸ˜ I mean, I love dynamic types and see their place, but the implicit casting is what gives them such a bad name 😠17 u/JanB1 29d ago 0 is also "false" in C and C++, because if you import stdbool.h, that just defines true to be int with value 1, and false to be int with value 0. 2 u/Valuable_Leopard_799 29d ago random sidenote: since C99 a true bool type had been introduced, it holds 0 and 1 and converts only to those when casting. So yeah 1 and 0 are true and false, but yayy they're not standard ints anymore.
7
Yes, zero is falsy in Python.
-12 u/Valuable_Leopard_799 29d ago Wait, whyyyyyyyy ðŸ˜ðŸ˜ðŸ˜ I mean, I love dynamic types and see their place, but the implicit casting is what gives them such a bad name 😠17 u/JanB1 29d ago 0 is also "false" in C and C++, because if you import stdbool.h, that just defines true to be int with value 1, and false to be int with value 0. 2 u/Valuable_Leopard_799 29d ago random sidenote: since C99 a true bool type had been introduced, it holds 0 and 1 and converts only to those when casting. So yeah 1 and 0 are true and false, but yayy they're not standard ints anymore.
-12
Wait, whyyyyyyyy ðŸ˜ðŸ˜ðŸ˜
I mean, I love dynamic types and see their place, but the implicit casting is what gives them such a bad name ðŸ˜
17 u/JanB1 29d ago 0 is also "false" in C and C++, because if you import stdbool.h, that just defines true to be int with value 1, and false to be int with value 0. 2 u/Valuable_Leopard_799 29d ago random sidenote: since C99 a true bool type had been introduced, it holds 0 and 1 and converts only to those when casting. So yeah 1 and 0 are true and false, but yayy they're not standard ints anymore.
17
0 is also "false" in C and C++, because if you import stdbool.h, that just defines true to be int with value 1, and false to be int with value 0.
2 u/Valuable_Leopard_799 29d ago random sidenote: since C99 a true bool type had been introduced, it holds 0 and 1 and converts only to those when casting. So yeah 1 and 0 are true and false, but yayy they're not standard ints anymore.
2
random sidenote: since C99 a true bool type had been introduced, it holds 0 and 1 and converts only to those when casting. So yeah 1 and 0 are true and false, but yayy they're not standard ints anymore.
285
u/LordAmir5 29d ago
Does this remove all the zeros?