Advertisements
Advertisements
Question
How is memory allocated to a list in Python?
Short Answer
Advertisements
Solution
- Python allocates memory dynamically for a list.
- The list stores a contiguous array of references to its objects.
- Its size is not fixed; memory is resized when elements are added or removed.
- The memory used by each reference depends on the system architecture, such as 32-bit or 64-bit mode.
shaalaa.com
Is there an error in this question or solution?
