On Thursday, April 30, 2015 at 1:05:05 PM UTC-4, Ben Finney wrote:
> Tim writes:
> > You can use 'extend' to add set elements to a list and use 'update' to
> > add list elements to a set.
>
> And you can use both of those methods to add items from a file::
>
> >>> foo = ['one', 'two']
> >
Tim writes:
> You can use 'extend' to add set elements to a list and use 'update' to
> add list elements to a set.
And you can use both of those methods to add items from a file::
>>> foo = ['one', 'two']
>>> bar = open('/usr/share/common-licenses/GPL-3')
>>> foo.extend(bar)
>>>
Hi Tim,
On 04/30/2015 10:07 AM, Tim wrote:
> I noticed this today, using Python2.7 or 3.4, and wondered if it is
> implementation dependent:
>
> You can use 'extend' to add set elements to a list and use 'update' to add
> list elements to a set.
>
m = ['one', 'two']
p = set(['three',
On Thu, Apr 30, 2015 at 10:07 AM, Tim wrote:
> I noticed this today, using Python2.7 or 3.4, and wondered if it is
> implementation dependent:
>
> You can use 'extend' to add set elements to a list and use 'update' to add
> list elements to a set.
It's not implementation dependent. Both methods