I'm trying to understand why int("0") > 0 evaluates to false while all([int(i) > 0 for i in "0"]) evaluates to true. Interestingly, [all(i != "0" for i in "0"] also evaluates to true.
How can I get my list comprehension to evaluate correctly, that is, catch the "0"?
intis being called with different types, because iterating over a string is givingCharobjects, not strings of length 1:and when given a
Char, Julia'sintis more like Python'sord:which gives rise to what you see:
There are lots of ways you could get this to behave as you expect, e.g. use
parseintor simply convert back to a string: