3 ms·
I believe list comprehensions would be much more readable if they were written the other way round: [for x in [for s in strList: if isNumeric(s): parseInt(
by pansa2 5y ago
I believe list comprehensions would be much more readable if they were written the other way round:
[for x in [for s in strList: if isNumeric(s): parseInt(s)]: if x != 0: x]
Nesting them is still ugly, but can often be avoided using an assignment expression:
[for s in strList: if isNumeric(s): if (x := parseInt(s)) != 0: x]