php > unset($a[1]);
php > var_dump($a);
array(2) {
[0]=>
string(1) "a"
[2]=>
string(1) "c"
}
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = ['a', 'b', 'c']
>>> a
['a', 'b', 'c']
>>> a.pop(1)
'b'
>>> a
['a', 'c']
>>> a[2]
Traceback (most recent call last):
File "
IndexError: list index out of range
>>> a[1]
'c'
>>> a[0]
'a'
>>>
No comments:
Post a Comment