O'Reilly logo
  • Sri Harsha V thinks this is interesting:

>>> [x + y for x in 'abc' for y in 'lmn'] ['al', 'am', 'an', 'bl', 'bm', 'bn', 'cl', 'cm', 'cn']

From

Cover of Learning Python, 5th Edition

Note

Nested looping in list comprehension.