A list is an ordered sequence of Python objects

  1. List generation

Lists can be generated with a pair of brackets’ [] ‘, separated by commas’, ‘

Empty lists can be generated using ‘[]’ or the list() function

Calculate the length of the list len()

List addition is equivalent to joining two lists in order

List multiplication is the same thing as repeating the sequence multiple times

3 Index and Fragment

Python uses whole segment substitution for consecutive shards with interval 1

The original shard is replaced by a new shard; the elements need not be the same

For a discontinuous shard with a non-1 interval, the number of elements must be the same

This mechanism can be used to delete unwanted fragments

Deletion of elements

Python provides a more general method for deleting elements, del

Judgment of affiliation

We can use the keyword in or not in to determine whether or not an element is in a sequence

\