The List Object and Its Internal Management
摘要
Some programming languages, such as C, require arrays to store only one type of data and to have their size defined in advance. The advantage of this approach is high performance and efficient memory usage, but it can feel restrictive if you are used to dynamically adding or removing elements in your code. In contrast, Python’s list has none of these constraints: you can store elements of different types, insert and remove items at any time, and don’t need to worry about whether they are numbers, strings, or any other kind—just put them in the list. This design is extremely convenient.