3 ms·
Isn't that answer technically incorrect as well? A more precise answer would be that tuples can store key-value pairs, but even then I think that part of the an
by aw1621107 4y ago
Isn't that answer technically incorrect as well? A more precise answer would be that tuples can store key-value pairs, but even then I think that part of the answer is unnecessarily narrow.
- whatshisface 4y agoTuples are integer-indexed and contiguous in Python, you can't index them with strings, and you can't have sparse arrays.
- aw1621107 4y agoI'm not sure how sparse arrays are relevant here? But in any case, I guess I have to agree that integer indexing arguably counts as key-value pairs? It's definitely not the the first thing that comes to mind for me when describing them.
- whatshisface 4y agoI'm arguing that key-value pairs are not a good way to think about tuples.
- aw1621107 4y agoI'm definitely not going to disagree with you there.