List type of data structure
List description
add element to List
To delete a list element
Change list elements
View list elements
List script operators
List interception and splicing
Nested lists
List built-in functions
I. Description of the list
The sequence is the most basic data structure in Python. Each element in the sequence is assigned a number-its position, or index, the first index is 0, the second index is 1, and so on.
Python has 6 built-in types of sequences, but the most common are lists and tuples.
Sequences can be performed by operations including indexing, slicing, adding, multiplying, and checking members.
Python has built-in methods for determining the length of a sequence and determining the maximum and minimum elements
Data items for a list do not need to have the same type
Create a list by enclosing separate data items separated by commas in square brackets. As shown below:
>>> li = ["zjk", 123,"python"]>>> Li2 = [1,2,3,4,5]>>> li3 = ["a","b" ,"C"]
Second, add elements to the list
List type of Python data structure