r/learnpython • • Oct 12 '26

Tuples..I don’t get it

Hi crew, I’m a Python newbie and I just learned about the concept of tuples.

We can’t change them.if we want to store we have to start at the index we want + 1.

I just don’t get it. Why wouldn’t we just use lists? When would we ever need this?

100 Upvotes

89 comments sorted by

View all comments

Show parent comment

4

u/kiochikaeke Oct 13 '26

Yeah, immutability is actually an advantage on its own as you and the system can both be sure this particular thing won't be changed by any stray code that mutates or has side effects, for you this helps to build safer, more predictable code and for the system it allows it to be clever with memory management and hashing.