When Python code needs indexed, array-like storage, a list is usually the practical choice. Unlike an array, a list can grow and can hold values without a fixed element type. section 3.5
Arrays have fixed length and type. Python lists are implemented with arrays of pointers and reserve extra space, so appending is usually convenient but can eventually trigger reallocation and pointer movement. section 3.5
Choose among these representations according to the task:
- Use lists or tuples for most ordinary Python array-like work. section 3.5
- Use the standard-library array type or NumPy arrays when a genuine typed array is appropriate. section 3.5
Observe list growth
Measure length and memory size while appending values. The reported size stays constant across several appends, then jumps when reserved capacity runs out.







































