On Jun 20, 9:43 pm, deathweaselx86 deathwea...@gmail.com wrote:
Howdy guys, I am new.
I've been converting lists to sets, then back to lists again to get
unique lists.
e.g
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type help, copyright,
Howdy guys, I am new.
I've been converting lists to sets, then back to lists again to get
unique lists.
e.g
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type help, copyright, credits or license for more information.
foo = ['1','2','3']
bar =
On Mon, Jun 20, 2011 at 1:43 PM, deathweaselx86 deathwea...@gmail.com wrote:
Howdy guys, I am new.
I've been converting lists to sets, then back to lists again to get
unique lists.
e.g
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type
On Mon, 20 Jun 2011 12:43:52 -0700, deathweaselx86 wrote:
Howdy guys, I am new.
I've been converting lists to sets, then back to lists again to get
unique lists.
e.g
Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48) [GCC 4.2.4 (Ubuntu
4.2.4-1ubuntu3)] on linux2 Type help, copyright,
Steven D'Aprano wrote:
On Mon, 20 Jun 2011 12:43:52 -0700, deathweaselx86 wrote:
I've been converting lists to sets, then back to lists again to get
unique lists.
I used to use list comps to do this instead.
foo = ['1','2','3']
bar = ['2','5']
foo.extend([a for a in bar if a not in foo]) foo
On Jun 21, 12:43 am, deathweaselx86 deathwea...@gmail.com wrote:
Howdy guys, I am new.
I've been converting lists to sets, then back to lists again to get
unique lists.
Maybe you should consider whether its best to work with sets only and
not use lists at all.
This needs to be said because: