anagram finder / dict mapping question

Arnaud Delobelle arnodel at googlemail.com
Fri May 9 02:02:47 EDT 2008


"Kam-Hung Soh" <kamhung.soh at gmail.com> writes:

> I avoid creating a temporary variable if it's only used once
> immediately,  so I would have written:
>
> newtlist = ''.join(sorted(list(line)))

Or ''.join(sorted(line))

as sorted() works with any iterable.

-- 
Arnaud



More information about the Python-list mailing list