python常用列表(数组)操作演示,python操作演示,s = ['h','e'
文章由Byrx.net分享于2019-03-23 09:03:23
python常用列表(数组)操作演示,python操作演示,s = ['h','e'
s = ['h','e','l','l','o'] #create a lists.append('d') #append to end of listlen(s) #number of items in lists.pop(2) #delete an item in the middles.sort() #sorting the lists.reverse() #reversing the lists.extend(['w','o']) #grow lists.insert(1,2) #insert into lists.remove('d') #remove first item in list with value es.pop() #remove last item in the lists.pop(1) #remove indexed value from lists.count('o') #search list and return number of instances founds = range(0,10) #create a list over range s = range(0,10,2) #create a list over range with start index and increment
评论关闭