Home

Marco Mariani wrote:
> Ricardo Aráoz ha scritto:
>
>> L = ['one', 'two', 'three', 'four', 'five']
>>
>> print L[0] # This would be 'head'
>> print L[1:] # This would be 'tail'
>>
>> Caution : L[0] and L[1:] are COPIES of the head and tail of the list.
>
> This might surprise people who see L[1:] = [], since changing a copy is
> not supposed to change the original.
>

Sorry, should have written RETURN copies instead of ARE copies.

previous
next

Re: STL Map Scoping Issue
Re: How to overwrite 'new' operation in c++
Re: How strongly are ncurses incompatible with signals?
Travel around the globe...
Re: The way to Truth - Hindu Religion
Fundacja Avalon
Mam Marzenie
Fundacja Iskierka
Akogo
Podaruj Zycie