对列表的增删改:
>>> s['ok', 'The', 'fox', 'when', 'small', 'iss']
>>> s.insert(2,'key')
>>> s
['ok', 'The', 'key', 'fox', 'when', 'small', 'iss']
>>> s.append('find')
>>> s
['ok', 'The', 'key', 'fox', 'when', 'small', 'iss', 'find']
>>> s.remove('iss')
>>> s
['ok', 'The', 'key', 'fox', 'when', 'small', 'find']
>>> s.index('fox')
3
5.4 Python中对列表的增删改
最新推荐文章于 2023-08-23 15:30:44 发布