>>> li.extend(['d', 'e', 'f'])

>>> li
['a', 'b', 'c', 'd', 'e', 'f']
>>> len(li)

6
>>> li[-1]
'f'
>>> li = ['a', 'b', 'c']
>>> li.append(['d', 'e', 'f'])

>>> li
['a', 'b', 'c', ['d', 'e', 'f']]
>>> len(li)

4
>>> li[-1]
['d', 'e', 'f']
644阅读 0评论2011-09-18 大方无隅
分类:Python/Ruby