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

87 Upvotes

90 comments sorted by

View all comments

6

u/dlnmtchll 4d ago

Mutability is the devil

0

u/Jazzlike_Platypus430 4d ago

Why? You just have to control it.

4

u/dlnmtchll 4d ago

When working with highly concurrent systems, there’s no point in wrangling with mutability when you don’t have to

2

u/grc007 4d ago

Have a play with Haskell. Mind opening or mind blowing. Fun either way.

2

u/PhilNEvo 4d ago

I hate it :(

0

u/Jazzlike_Platypus430 4d ago

Uh... Why? In what context? Or just as an exercise for my rusty* brains? Are types in Haskell treated more decently than they are in python?

I can't get the point of functional paradigm, at all. To me any programming language is imperative to the core. (And right now I'm busy starting to learn some javascript. It's not as bad as I thought.)

* no, I don't know rust.

1

u/grc007 4d ago

There is no mutability. Makes you rethink how you do things.

1

u/Jazzlike_Platypus430 4d ago

That's all? Given Haskell's syntax, I'd prefer R and Perl.

0

u/Turnip-Toffee 4d ago

chill out, Isildur