![Are Tuples More Like Lists or Strings? And Why We Don't Really Care * [Club]](https://substackcdn.com/image/fetch/$s_!HoKw!,f_auto,q_auto:best,fl_progressive:steep/https%3A%2F%2Fthepythoncodingstack.substack.com%2Ftwitter%2Fsubscribe-card.jpg%3Fv%3D-1980961260%26version%3D9)
"This post is not about tuples. It's not about lists or strings, either. It's about Python, about its philosophy when dealing with data types, about how you should think about data types when coding in Python. Tuples are usually introduced to Python learners after lists and strings. They're almost always described as "like lists, but a bit different". And that's not a bad thing. I say similar things when I introduce tuples to students."
"Tuples are usually introduced to Python learners after lists and strings. They're almost always described as "like lists, but a bit different". And that's not a bad thing. I say similar things when I introduce tuples to students. But then, fast-forward a few levels of proficiency, and I'm having different discussions with students. Are tuples like lists? Are they like strings? But the point is that those questions don't really make sense."
Tuples are often presented after lists and strings and framed as similar but slightly different. Beyond initial comparison, programmers should evaluate types by semantics, intended use, and behaviors rather than surface resemblance. Tuples differ in mutability, intended role, and how they convey programmer intent, which matters for design and code reasoning. The Club will provide frequent short posts, occasional complementary videos, forums, Q&As, code reviews, and other resources for subscribers. Practical examples and thought experiments, like modeling a row of houses, help choose between dictionaries, lists, tuples, or other structures based on real-world semantics.
Read at Thepythoncodingstack
Unable to calculate read time
Collection
[
|
...
]