Single format descriptor for list

Paul Appleby pap at nowhere.invalid
Thu Jan 21 10:53:36 EST 2016


Thanks all for the answers.


Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:

>>>> print(('{}th\n' * len(a)).format(*a))
>>>> print(''.join(map('{}th\n'.format, a)))

Those two look closest to what I was hoping for, I guess, but as Chris 
Angelico said, it probably is clearer to just loop over the range.



More information about the Python-list mailing list