5 ms·
How about list(set(aList)) ? Anyway, to answer your question, look in the Python FAQ at http://www.python.org/doc/faq/general/ http://www.python.org/doc/faq/gen
by gms 19y ago
How about list(set(aList)) ? Anyway, to answer your question, look in the Python FAQ at http://www.python.org/doc/faq/general/ http://www.python.org/doc/faq/general/
But really, you shouldn't care about this sort of thing, until it actually matters.
- ivankirigin 19y agoYou're right, don't do this till it matters. But even in profiling and optimizing, the first steps are algorithmic. If you can't change the "outer loop" algorithm, you'll probably look into things like this.