On Apr 21, 12:56 pm, candide wrote:
> Is the del instruction able to remove _at the same_ time more than one
> element from a list ?
>
> For instance, this seems to be correct :
>
> >>> z=[45,12,96,33,66,'c',20,99]
> >>> del z[2], z[6],z[0]
> >>> z
> [12, 33, 66, 'c', 20]
> >>>
>
> How
Thanks for your reponses.
--
http://mail.python.org/mailman/listinfo/python-list
On 4/21/2010 12:56 PM candide said...
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
Not as I see it -- watch your index values - they change after each
delete is co
On Apr 21, 2:56 pm, candide wrote:
> Is the del instruction able to remove _at the same_ time more than one
> element from a list ?
>
> For instance, this seems to be correct :
>
> >>> z=[45,12,96,33,66,'c',20,99]
> >>> del z[2], z[6],z[0]
> >>> z
> [12, 33, 66, 'c', 20]
> >>>
>
> Howe
candide wrote:
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[2], z[6],z[0]
>>> z
[12, 33, 66, 'c', 20]
>>>
However, the following doesn't work :
>> z=
On 21 April 2010 20:56, candide wrote:
> Is the del instruction able to remove _at the same_ time more than one
> element from a list ?
Yup:
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[:]
>>> z
[]
--
Cheers,
Simon B.
--
http://mail.python.org/mailman/listinfo/python-list
Is the del instruction able to remove _at the same_ time more than one
element from a list ?
For instance, this seems to be correct :
>>> z=[45,12,96,33,66,'c',20,99]
>>> del z[2], z[6],z[0]
>>> z
[12, 33, 66, 'c', 20]
>>>
However, the following doesn't work :
>> z=[45,12,96,33,66,