List Delete: delete one item and delete an entire section,entiresection,L = ['SPAM!'
List Delete: delete one item and delete an entire section,entiresection,L = ['SPAM!'
L = ['SPAM!', 'eat', 'more', 'please']del L[0] # delete one itemprint Ldel L[1:] # delete an entire sectionprint L # same as L[1:] = []
- List: delete a slice :2,deleteslice,inventory =
- List reverse(): Reverse the elements of the list, in pla
- List: display a slice,listdisplayslice,inventory =
- Getting a List Subset: Slicing,subsetslicing,li = ['a'
- Nested list: two dimensions,nesteddimensions,matrix =
- Demonstrates nested sequences,demonstratesnested,score
热门文章:
相关内容
- List: delete a slice :2,deleteslice,inventory =
- List reverse(): Reverse the elements of the list, in place,reversee
- List: display a slice,listdisplayslice,inventory =
- Getting a List Subset: Slicing,subsetslicing,li = ['a', '
- Nested list: two dimensions,nesteddimensions,matrix = [[1
- Demonstrates nested sequences,demonstratesnested,scores = []#
- Test for membership with in,testmembership,inventory =
- Defining Dictionaries: shows an example of a dictionary definition.,
- Dictionary for loop,dictionaryforloop,dict = {'x':
- Use tuple as key,usetupleaskey,Matrix = {}M
评论关闭