I’ve just been learning lambda (About time) and I’ve figured some things out, I get the general idea.
I have a map() with a lambda here that can surely be made shorter, but I don’t know how:
map(lambda x: [ x.split()[0], x.split()[2], x.split()[4] ] , y)
I hoped it would be possible to get the 0, 2 and 4 elements of the split ‘x’ at once, but currently I have to split it 3 times to get them…
1 Answer