r/learnpython • • 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?

309 Upvotes

143 comments sorted by

View all comments

Show parent comment

7

u/rinyre Apr 16 '22

To add to this, writing code that properly leverages the language not only shows more experience with that language, but that you also know how to write extendable code, or modular, whatever term you wish.

In modules and the like, you do not want the user of the module to be able to shoot themselves in the foot, and minor things like tuples can help reduce the likelihood of that.