1. Can add list content append
2. You can count the number of times a list segment appears in the entire list
3. You can insert a string and split each letter of the entire string as a list segment to append to the list Extedn
4. You can query a list segment at the location of the entire list index
5. You can insert a list segment inserts at the specified location
6. You can delete the last list segment pop of a list
7. You can delete a list segment in the specified list remove
8. Can forward reverse sort reverse
9. You can sort by letter or number
10. Use bracket "[]" when defining the list
Note: in the list, if one of the two list segments is the same, whether using index or remove is the top-most-listed segment of the statistic
1. You can count the number of times a tuple segment appears in the entire tuple
2. You can query the tuple number index of a tuple segment in the entire tuple
3. Use parentheses when defining tuples "()"
#定义列表 >>> name_list = [' Sean ', ' Tom ', ' Jack ', ' Angelia ', ' Daisy ', ' Jack '] #查看定义的列表 >>> name_list [' Sean ', ' Tom ', ' Jack ', ' Angelia ', ' Daisy ', ' Jack '] #增加david列表段 >>> name_list.append (' David ') >>> name_list [' Sean ', ' Tom ', ' Jack ', ' Angelia ', ' Daisy ', ' Jack ', ' David ' #统计david列表段出现次数 >>> name_list.count (' David ') 1 >&G T;> name_list.count (' Jack ') 2 #使用extend向列表中增加列表段 >>> name_list.extend (' hello,my name is Sean ') >>> name_list [' Sean ', ' Tom ', ' Jack ', ' Angelia ', ' Daisy ', ' Jack ', ' David ', ' H ', ' e ', ' l ', ' l ', ' o ', ', ', ', ', ', ', ', ', ', ' A ', ', ', ' e ', ', ' I ', ' s ', ', ', ', ' e ', ' a ', ' n ', #查看列表段所在的索引号, note here the statistics of Jack for the first Jack ID number >>> Name_list.index (' j Ack ') 2 >>> name_list.index (' Tom ') 1 #向索引号为2的地方插入Adam >>> Name_list.insert (2, ' Adam ') >>> name_list [' Sean ', ' Tom ', ' Adam ', ' Jack ', ' Angelia ', ' Daisy ', ' Jack ', ' David ', ' H ', ' e ', ' l ', ' l ', ' o ', ', ', ' M ', ' y ', ', ' , ' n ', ' A ', ' m ', ' e ', ', ', ' I ', ' s ',', ' s ', ' e ', ' a ', ' n '] #删除最后一个列表段 >>> name_list.pop () ' n ' >>> name_list [' Sean ', ' Tom ', ' Adam ', ' Jack ' , ' Angelia ', ' Daisy ', ' Jack ', ' David ', ' H ', ' e ', ' l ', ' l ', ' o ', ', ', ' m ', ' y ', ', ' n ', ' A ', ' m ', ' e ', ', ' I ', ' s ', ', ' , ' s ', ' e ', ' a '] #删除指定列表段, note that the deletion here is the first Jack >>> name_list.remove (' Jack ') >>> name_list [' Sean ', ' Tom ', ' a Dam ', ' Angelia ', ' Daisy ', ' Jack ', ' David ', ' H ', ' e ', ' l ', ' l ', ' o ', ', ', ' m ', ' y ', ', ' n ', ' A ', ' m ', ' e ', ', ' I ', ' s ', ', ', ', ' e ', ' a '] #对整个列表进行倒序 >>> name_list.reverse () >>> name_list [' A ', ' e ', ' s ', ', ', ', ', ', ', ', ' ', ' ', '], ' , ' e ', ' m ', ' a ', ' n ', ', ' y ', ' m ', ', ', ' o ', ' l ', ' l ', ' e ', ' H ', ' David ', ' Jack ', ' Daisy ', ' Angelia ', ' Adam ', ' Tom ', ' SE An '] #对整个列表进行倒序 >>> name_list.reverse () >>> name_list [' Sean ', ' Tom ', ' Adam ', ' Angelia ', ' Daisy ', ' Jack ', ' David ', ' H ', ' e ', ' l ', ' l ', ' o ', ', ', ' m ', ' y ', ', ' n ', ' A ', ' m ', ' e ', ', ' I ', ' s ', ', ', ', ' e ', ' a ', #对整个列表进行列表 The first letter of the paragraph is sorted >>> NamE_list.sort () >>> name_list [', ', ', ', ', ', ', ', ', ', ', ', ' Adam ', ' Angelia ', ' Daisy ', ' H ', ' M ', ' a ', ' a ', ' David ', ' e ', ' E ', ' e ', ' I ', ' Jack ', ' l ', ' l ', ' m ', ' n ', ' o ', ' s ', ' s ', ' Sean ', ' Tom ', ' Y '] >>>