3 ms·
Or this: def to_strings(seq): return map(str, seq) Generally, when the operation I'm applying to each element happens to already be a named functi
by EvilTerran 10y ago
Or this:
def to_strings(seq):
return map(str, seq)
Generally, when the operation I'm applying to each element happens to already be a named function, I find "map(f, seq)" preferable to "(f(x) for x in seq)".