[Events] Python Summer Camp
Carl Karsten
carl at nextdayvideo.com
Sat May 17 15:11:29 UTC 2014
On Sat, May 17, 2014 at 4:34 AM, Shaifali Agrawal <
agrawalshaifali09 at gmail.com> wrote:
> * data structures
>
> - numbers
> - string
> - list
> - tuples
> - dictionary
>
> I think you should add * set
Which got snuck in some time ago, I am not sure when. Sneaky python core
dev team working like elves.
carl at twist:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a={1,2,3}
>>> a
set([1, 2, 3])
>>> b={3,4,5}
>>> a & b
set([3])
>>> a | b
set([1, 2, 3, 4, 5])
>>> a-b
set([1, 2])
>>> a.add(4)
>>> a
set([1, 2, 3, 4])
>>> a.add(4)
>>> a
set([1, 2, 3, 4])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhatch.org/pipermail/events/attachments/20140517/6f3cb3e7/attachment.html>
More information about the Events
mailing list