Converting a set into list

TheSaint nobody at nowhere.net.no
Sat May 14 05:02:48 EDT 2011


Hello

I've stumble to find a solution to get a list from a set

<code>

>>> aa= ['a','b','c','f']
>>> aa
['a', 'b', 'c', 'f']
>>> set(aa)
{'a', 'c', 'b', 'f'}
>>> [k for k in aa]
['a', 'b', 'c', 'f']

</code>
I repute the comprehension list too expensive, is there another method?

-- 
goto /dev/null



More information about the Python-list mailing list