Steven D'Aprano wrote: > L = ["zero" if n == 0 else \ > "negative " + ("odd" if n % 2 else "even") if n < 0 else \ > "odd" if n % 2 else "even" for n in range(8)] > BTW, the continuation is not necessary I believe.
[ x==0 and "zero" or ["","-"][x < 0] + ("even", "odd")[x%2] for x in range(8) ] isn't too bad. though I like the C one a bit more(as it doesn't overload the and/or) [ x==0 ? "zero" : ["","-"][x < 0] + ("even", "odd")[x%2] for x in range(8) ] As it is still a very straight forward flow(from left to right, without "internal decision split in between"). -- http://mail.python.org/mailman/listinfo/python-list