escape sequences in list comprehensions

kartik kartick_vaddadi at yahoo.com
Fri Nov 12 14:17:51 CET 2004


Escape sequences don't seem to work in strings within list comprehensions:
>>> print ['%s\n' %i for i in [1,2,3]]
['1\n', '2\n', '3\n']

What am I missing?

Thank you.



More information about the Python-list mailing list