Python Created by Guido Creating Python Before , He used it 10 I've been working on something called ABC Language , This language is tailored for beginners . stay ABC It defines a lot of things like Python Properties of : Sequence canonical operations 、 Built in tuples and mapping types 、 Indent layout structure 、 Strongly typed variables without declaration, etc . therefore ,Python It's not accidental to be so user-friendly , It comes from the original ABC Some features of language are inherited .
Python from ABC Language inherits the habit of sequential unified operation , character string 、 list 、 Byte sequence 、 Array 、XML Element set and result set of database , All use a common set of operations , For example, iterative access 、 section 、 Sort and join operations .
master Python All kinds of sequences in , It can save us the code of repeatedly constructing the same function , And those interfaces are examples of what we've learned , Whatever the current sequence type , Or the type of container of the future , All can be satisfied .
Overview of built-in sequence containers
Python The standard library provides a wide range of Sequence container types , The bottom layer of them is C Language to achieve , There are two main categories :
At the same time, it can put containers of different data types : list 、 Tuples and collections.deque.
Only one type of container can be placed at the same time :str、bytes、bytearray,memoryview and array.array.