#python - Wed 9 May 2007 between 00:00 and 00:07

NY Lost Funds



lvmcset2 = 1, 44, 22, 333
i need remove the repetion "1"
if i do set1 - set2
the repetion is not removed
i'm working with strings
TFKylelvmc: ok, what do you want, to have 1 in set1 but not set2, or just a set/list with all the elements from set1/set2 in but with 1 only in once?
lvmci need all elements in set1 - repetion elements in set2
qebabuse lists
lvmca - b
i can't make it with lists
TFKyleok, then set1 -= set2 would work
qebabthen do list3 = list(set(list1 + list2))
lvmclet me try
qebab>>> list(set([1, 2, 3, 4, 5] + [1, 44, 22, 333]))
[1, 2, 3, 4, 5, 44, 333, 22]
that is what you want?
lvmcyes
TFKyleah, then you could've just used set1 + set2
just you said you didn't want to do that earlier when I asked
qebabyou can add sets?
TFKyleyep
qebab>>> a = set([1, 2, 3, 4, 5]) + set([1, 2, 7, 9])
TypeError: unsupported operand type(s) for +: 'set' and 'set'
TFKylehrm, indeed
thought you could
qebabI don't know why I knew that
AaronBradyhi
TFKylewonder why you can't, seems logical to me to be able to
lvmcqebab,
self.alnfaltas = list(set(self.alnfile - self.alnpresentes))
AaronBradyah home.
lvmceError: unsupported operand type(s) for -: 'list' and 'set'
TFKylelvmc: you can't - list, just +
AaronBradygot a question. will just post.
TFKylelvmc: use a set if you need to -
or sets rather
lvmcTFKyle, look the code...
qebablvmc: then one of your parameters is a set, not a list
cordenjust how to download Qt? Im using ubuntu 6.10 and 7.04. tnx
AaronBradycan we get some classes in the standard library? certain functions are nice to override.

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive

NY Lost Funds