# Coding=utf-8
# List List function
#attributes of the list: You can have any type of value that can be changed#can be changed, added, deleted, modified#increase append directly at the tail increaseList_1 = [22, 33333,'Demo']list_1.append ('99999')Print(list_1)#Add Insert (i,x) to increase in the specified position,#I'm where your element is. Subscript starting from 0#x is the value you want to insert into the listList_1 = [22, 33333,'Demo']list_1.insert (0,'Zero')Print(list_1)#add extend to merge two lists into a listList_1 = ['Demo','Demo2','Demo3']list_2= ['python','Python2','Python3']list_1.extend (list_2)Print(list_1)#Delete PopList_1 = ['Demo','Selenium','Driver']list_1.pop ()#Delete an element from the end by defaultPrint(list_1) list_1.pop (0)#deletes the element at the specified positionPrint(list_1)#Delete Remove to specify the deleted elementList_1 = ['Demo','python','PHP']list_1.remove ('Demo')Print(list_1)#Change = Assignment OperationList_1 = ['Demo','python','PHP']list_1[0]='Java'Print(list_1)#list go to reset setList_1 = ['Demo','python','PHP','Java','PHP','python']Print(List (set (list_1)))#Sorting SortList_1 = ['Demo','python','PHP']list_2= [1, 88, 999, 1233]list_1.sort ()Print(list_1) list_2.sort ()Print(list_2)#Reverse reverse ()List_1 = ['Demo','python','PHP']list_2= [1, 88, 999, 1233]list_1.reverse ()Print(list_1) list_2.reverse ()Print(list_2)#counts the Count list. (obj)List_1 = ['Demo','python','PHP','Java','PHP','python']list_1.count ('python')Print(list_1)
Life is short _ I use Python_list (list) _002