Python Data Structures-Week 2 & 3

Nishant SharmaNishant Sharma
4 min read

Sub PPL!
It’s that time again, where I show up and walk you through my progress in a short little article.
Looking back at it now, this week was wayyyyyy more chaotic and confusing compared to week 1. But at the same time, it was equally rewarding and reassuring. All in all, this week really reinforced my reason for choosing to learn Python in the first place.
So let’s break down every small victory and lesson learned.

Seeing the title, it is pretty clear. That this blog is going to be about Python’s data structures. So lets dive inside each one of them in a bit detail.

  1. Strings: Strings are one of the most primitive and simple data structures in Python. Strings are a collection of alphabets and/or numbers arranged in a sequence. They’re immutable—which basically means an object that cannot be changed once its value is set.

    Anytime you’ve used the input() function, the value you receive is a string. Or in your first ever code:
    print("Hello World")
    Everything inside those double quotes is a string.

    Python also gives us a bunch of built-in methods to work with strings in a faster, easier way. To
    explore these methods properly, I highly recommend spending a few days with the Python documentation.

  2. Lists:
    Lists are another important data structure in Python. They’re denoted using square brackets [], and store things in the order you put them in. Unlike strings, lists are mutable.

    To understand lists better, think of them like a grocery list. You can add (.append()) items to your list, or remove (.remove()) items whenever needed. The items stay in the sequence you entered them, and—this is cool—a list can contain a mix of stuff: strings, integers, floats, other lists, etc. (All these traits are very similar to that of any generic list we make in our everyday life).

    This freedom to modify them after creation is what makes them mutable.

  3. Dictionaries:
    One thing I personally love about Python is how sensible and intuitive some of the reserved keywords are. Take “dictionary”, for example—it makes too much sense.
    Just like a real dictionary holds unique words and their definitions, a Python dictionary lets us store unique keys and their associated values. And just like real life, you can have different keys with the same value (basically like synonyms).
    A dictionary can be thought of as a more practical version of a list—especially when the dataset is large. Imagine a list with 5 items. To access one of them via list, you’d have to remember its index (its exact position). But with a dictionary, you can refer to each item directly using its key, which is much easier and readable, therefore its also called as a key-value pair

    It’s like trying to remember a chapter just by its number vs. remembering it by its name. You already know which one’s better.

  4. Tuples:
    Tuples are immutable objects.
    Think of tuples as lists that cannot be changed. Now you might ask—“If we already have lists, why do we even need tuples?”

    Here’s the thing: since tuples are immutable, Python stores them in a more memory-efficient way. That makes them really useful when dealing with larger volumes of data, especially when that data doesn’t need to be changed.

Tip of the Week:
Instead of relying only on your course or a YouTube tutorial, try spending time exploring the Python documentation yourself. I cannot emphasize this enough. Reading the docs helps you learn by doing, builds deeper understanding, and exposes you to topics your instructor might skip.
The best part? Once you start navigating docs comfortably, you level up as a self-learner. No joke.

So yeah, this week was a total ride. A bit confusing at parts, but every bug, every random print statement, and every small “Ohhh that’s how it works!” moment made it all worth it. Python’s data structures may sound scary at first, but once you get the hang of it—they actually feel kinda intuitive. And I can now confidently say that learning Python, will get nasty sometimes, but in a while it will all start to make sense again. Whether you're just starting out or already halfway in—stick with it. Break things, google stuff, and read the docs (seriously, read the docs). You'll be surprised how quickly things start clicking.

0
Subscribe to my newsletter

Read articles from Nishant Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nishant Sharma
Nishant Sharma

17 y/o Bangalorean (yep, from Bangalore) — primarily diving into Python, but trying to keep up with the fast, chaotic world of tech and all its wonderfully terrible-terrific-yet tranquil and trendsetting languages. . . . . . Connect with me on Insta if something actually seems interesting — though, fair warning, there’s not much there (yet)