List slice assignment: delete and insert,sliceassignment,L = ['spam',
List slice assignment: delete and insert,sliceassignment,L = ['spam',
L = ['spam', 'Spam', 'SPAM!']print LL[0:2] = ['eat', 'more'] # slice assignment: delete+insertprint L # replaces items 0,1
相关内容
- List slicing,listslicing,numbers = [1
- A tuple consists of a number of values separated by commas,tuplecom
- tuple assignment,tuple,nudge = 1win
- Empty tuples are constructed by an empty pair of parentheses,tuples
- List inside a tuple,listinsidetuple,T = (1, [2,
- Tuple assignment in for,tupleassignment,T = [(1, 2),
- Tuple inside a list and reference tuple element,tupleelement,L = ['
- Delete dictionary entry,dictionaryentry,d2 = {'spam'
- Create a dictionary and fetch value by key,dictionaryfetch,d2 = {'s
- Dictionary: Get value by key,dictionaryvalue,d2 = {'spam'
评论关闭