>>> a='abcde'
>>> len(a)
5
>>>
>>> for i in range(1,3):
print(i)
1
2
>>> for i in range(3):
print(i)
0
1
2
>>> a
[1, 2, 3, 4, 5]
>>> a[0]
1
>>> b=(1,2,3,4,5,6)
>>> b(0)
Traceback (most recent call last):
File "
", line 1, in
b(0)
TypeError: 'tuple' object is not callable
>>> b[0]
1
>>>
>>> a
[1, 2, 3, 4, 5]
>>> a.append(10)
>>> a
[1, 2, 3, 4, 5, 10]
>>> del a[5]
>>> a
[1, 2, 3, 4, 5]
>>>
>>> a=[['da', 'a', 's', 's', 'f', 'g'], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]]
>>> a[1][1]
2.0
>>>
阅读(1298) | 评论(0) | 转发(0) |