2 ms·
What do you mean? > When tested for truth, only false and nil evaluate to a false value. Everything else is true (including 0, 0.0, "", and []). In ruby only
by greenpeas 4y ago
What do you mean?
> When tested for truth, only false and nil evaluate to a false value. Everything else is true (including 0, 0.0, "", and []).
In ruby only `false` and `nil` evaluate to false values. 0, [], "" all evaluate to true when used in `if` statements. In python (just like in C and JS) many things evaluate to false (including 0, 0.0, "", and []).
- vault 4y agoAh sorry I read "Unlike Ruby, in Python" instead of "Unlike Python, in Ruby"