Filip GruszczyĆski: > [1, 0, 0, 1] -> ['b', 'b', 'a', 'a', 'b', 'b']
I like this version (43 golf holes), it's readable enough:
[c for d in[1,0,0,1]for c in("a","bb")[d]]
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Filip GruszczyĆski: > [1, 0, 0, 1] -> ['b', 'b', 'a', 'a', 'b', 'b']
I like this version (43 golf holes), it's readable enough:
[c for d in[1,0,0,1]for c in("a","bb")[d]]
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list