Jan Danielsson wrote:
> Gary Herron wrote:
>>... a more recent addition to the language is Sets, ...
>from sets import Set
>Set([1,2,3,4,5,6]) - Set([2,3,6])
>>
>>Set([1, 4, 5])
If you are using 2.4 or later, you can simply use "set" without
importing anything.
set(['apple', 'orange'
Gary Herron wrote:
[---]
>> I just tried typing the above in Python, and it - obviously - doesn't
>> work, so it must be some other syntax.
>>
>>
> Not with tuples, lists or dictionaries. However a more recent addition
> to the language is Sets, and they support set differences:
>
from s
Jan Danielsson wrote:
> Hello all,
>
>I'm 100% sure that I saw an example which looked something like this
> recently:
>
>
a=(1, 2, 3, 4, 5, 6)
b=(2, 3, 6)
a - b
>
> (1, 4, 5)
>
>The only new language I have been involved in lately is Python. Is my
> memory failing me, or h
On Mon, 13 Jun 2005 20:52:43 -0400, Gary Herron wrote
(in article <[EMAIL PROTECTED]>):
> Jan Danielsson wrote:
>
>> Hello all,
>>
>> I'm 100% sure that I saw an example which looked something like this
>> recently:
>>
>>
>>
> a=(1, 2, 3, 4, 5, 6)
> b=(2, 3, 6)
> a - b
>
Jan Danielsson wrote:
>Hello all,
>
> I'm 100% sure that I saw an example which looked something like this
>recently:
>
>
>
a=(1, 2, 3, 4, 5, 6)
b=(2, 3, 6)
a - b
>(1, 4, 5)
>
> The only new language I have been involved in lately is Python. Is my
>memory failin