On Tue, 01 Jul 2008 12:35:01 -0700, Tobiah wrote:
> list.append([1,2]) will add the two element list as the next
> element of the list.
>
> list.extend([1,2]) is equivalent to list = list + [1, 2]
> and the result is that each element of the added list
> becomes it's own new element in the origin
On 1 juil, 21:35, Tobiah <[EMAIL PROTECTED]> wrote:
> list.append([1,2]) will add the two element list as the next
> element of the list.
list.append(obj) will add obj as the last element of list, whatever
type(obj) is.
> list.extend([1,2]) is equivalent to list = list + [1, 2]
Not quite. The se
On Jul 1, 12:35 pm, Tobiah <[EMAIL PROTECTED]> wrote:
> list.append([1,2]) will add the two element list as the next
> element of the list.
>
> list.extend([1,2]) is equivalent to list = list + [1, 2]
> and the result is that each element of the added list
> becomes it's own new element in the orig
list.append([1,2]) will add the two element list as the next
element of the list.
list.extend([1,2]) is equivalent to list = list + [1, 2]
and the result is that each element of the added list
becomes it's own new element in the original list.
Is that the only difference?
>From the manual:
s.ex