Definition of a list
Define an empty list
list = []
Defines a list that contains elements that can be any class
Type, including numeric types, lists, strings, etc. are available.
650) this.width=650; "src=" http://img.blog.csdn.net/20170714164204028 "alt=" 20170714164204028 "/>
Index of the list
The subscript is calculated starting from 0, such as list[0] reading a column
The 1th element of a table;
List[-1] reads the bottom 1th element of the list;
650) this.width=650; "src=" http://img.blog.csdn.net/20170714164341514 "alt=" 20170714164341514 "/>
Slices of a list
650) this.width=650; "src=" http://img.blog.csdn.net/20170714164423669 "alt=" 20170714164423669 "/>
Repetition of strings, connection, length, substring judgment, etc.
650) this.width=650; "src=" http://img.blog.csdn.net/20170714164657585 "alt=" 20170714164657585 "/>
to view the available actions for a list :
Dir (LI)
650) this.width=650; "Src=" http://img.blog.csdn.net/20170706093114167?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvagvsbg9qdwnjyq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Center "/>
Adding a list
The list can be added by the Append method;
650) this.width=650; "src=" http://img.blog.csdn.net/20170714164827381 "alt=" 20170714164827381 "/>
If I want to add multiple elements, the list can be added by the Extend method
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165113025 "alt=" 20170714165113025 "/>
Adds an element at the specified location using the inert method;
L.insert (Index, object)
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165205395 "alt=" 20170714165205395 "/>
Modification of the list
Modify the elements of the list: directly re-assign values;
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165303106 "alt=" 20170714165303106 "/>
View of the list
View the following table for a list element with the index method;
View the number of occurrences of a list element with the Count method;
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165532766 "alt=" 20170714165532766 "/>
Deletion of the list
List.remove (list[])
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165624373 "alt=" 20170714165624373 "/>
List.pop () The last element in the pop-up list
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165728683 "alt=" 20170714165728683 "/>
Deletion of the list
Del (list[])
650) this.width=650; "src=" http://img.blog.csdn.net/20170714165818383 "alt=" 20170714165818383 "/>
python--List