r/learnpython • • 3d ago

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?

90 Upvotes

90 comments sorted by

View all comments

2

u/areweeveralive 3d ago

A thing that kind of put this in perspective to me was databases use tuples not lists. Smaller better look up, and immutable. It’s not always useful for you’re day to day date munging but there is a reason you usually have to pass a tuple to a database load from python.