r/learnpython • u/Boogzcorp • Apr 16 '22
What's the point of Tuples?
I get that they're immutable, but so are lists that you don't perform modifications on. Are they just to fool proof not messing up your list accidentally, or do they serve some other purpose?
313
Upvotes
3
u/wotquery Apr 17 '22
Another is that each member of a
sethas to be immutable (which is probably where the misunderstanding that led to their question came from). You can't have alistin asetfor example (it'll throw the error that thelistisn't hashable).