To create a list of lists:
Liebiao = List (["Parameter 1", "Parameter 2"])
Liebiao = ["Parameter 1", "Parameter 2"]
Quickly create a list of 1~9: Liebiao = [I for I in Range (1,10)]
List operation methods:
List.append (obj) adds a new object at the end of the list
List.count (obj) counts the number of occurrences of an element in a list
List.extend (*obj) appends multiple values from another sequence at the end of the list (expands the original list with a new list)
List.index (obj) find the index position of the first occurrence of a value from the list
List.insert (Index,obj) Inserts an object into the list, the first parameter can be a position
List.pop (Obj=list[-1] Removes an element from the list (the last element by default) and returns the value of the element
List.remove (obj) removes the first occurrence of a value in a list
Liest.reverse () The elements in the reverse list
List.sort[func] Sort the original list, reverse=true the order from the big to the small when the parameter is
List.clear () Empty This list (feel no eggs ...)
The list function in Python