educative.io

Educative

Python list elements stored in contiguous memory locations

In the List Quiz, there is a true or false question stating that “Python list elements stored in contiguous memory locations” is False.
While in the Linked Lists vs. Lists section, it says that “Lists are arranged contiguously in the memory, while nodes of a linked list may be dispersed in the memory”
I am really confused about this.

Hey @Yunfan_Zhou!
The objects of lists themselves are stored in random memory locations, whereas the pointers that make up the list are stored in sequential locations. That’s why the statement "Python list elements stored in contiguous memory locations” is False.

Yes and that is the explanation of that quiz question. I wonder whether the second statement in my question is related to the first one. So the lists are arranged contiguously in the memory but the list elements are not stored in contiguous memory location?