In python, the list
data structure is a sequence of elements.
Similarly, a tuple
is also a sequence of elements, however, tuples are immutable
.
Whats the reason for making such a similar data structure, thats only feature, as opposed to lists, is that it can't be changed? Does it perhaps save memory space, by being immutable?
Also if a list and a tuple contains the exact same data, will they use the same amount of space in the memory?