Reference Address: https://www.cnblogs.com/alex3714/articles/5717620.html
List
>>> List1 = ['Physics','Chemistry', 1997, 2000];#access List>>>List1[0]'Physics'>>> List1[0:2]['Physics','Chemistry']>>> List1[-1]#adding a symbol is to access the element from the back forward2000#Update list>>> list1[2] ="ABCD">>>list1['Physics','Chemistry','ABCD', 2000]#Delete List>>>delList1[2]>>>list1['Physics','Chemistry', 2000]#Add new at the end of the list>>> List1.append ("newobj")>>>list1['Physics','Chemistry', 1997, 2000,'newobj']#Count the number of occurrences of an element in a list>>> List1.count (1997)1#inserting an object into a list>>> List1.insert (2,"Insertobj")>>>list1['Physics','Chemistry','Insertobj', 1997, 2000,'newobj']#removes an element from the list (the last element by default), and returns the value of the element>>> result=List1.pop ()>>>result'newobj'>>>list1['Physics','Chemistry','Insertobj', 1997, 2000]#to remove the first occurrence of a value in a list>>> List1.remove (1997)>>>list1['Physics','Chemistry','Insertobj', 2000]#append multiple values from another sequence at the end of a list>>> List1.extend ([1,2,3,4])>>>list1['Physics','Chemistry','Insertobj', 2000, 1, 2, 3, 4]#reverse List of elements>>>List1.reverse ()>>>list1[4, 3, 2, 1, 2000,'Insertobj','Chemistry','Physics']#sort the original list to sort only on the same data type>>> List1 = ['Physics','Chemistry','Insertobj']>>>List1.sort ()>>>list1['Chemistry','Insertobj','Physics']
Meta-group
Tuples are also called read-only lists
Python Basics 2