Going crazy...
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Mon Jun 13 21:11:08 EDT 2005
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 have I seen such an Python-example somewhere? If
> so: Where; or more importantly: How does it work?
>
> I just tried typing the above in Python, and it - obviously - doesn't
> work, so it must be some other syntax.
Try sets:
>>> a=set([1,2,3,4,5,6])
>>> b=set([2,3,6])
>>> a-b
set([1, 4, 5])
>>>
--Irmen
More information about the Python-list
mailing list