Dictionaries (Part 1): Key-value pairs, creating dictionaries, accessing values
After exploring the ordered worlds of lists and **tuples**, we now dive into one of Python's most powerful and flexible data structures: the dictionary. Unlike lists and tuples which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type.
Introduction to Python Collections Module: namedtuple, deque, Counter
We've now mastered Python's four core collection types. But what happens when you need a more specialized tool? The collections module in Python's standard library provides high-performance, specialized container datatypes. In this article, we'll introduce three of the most useful: namedtuple, deque, and Counter.
Lists (Part 1): Introduction to lists, declaring and initializing lists
Following our exploration of combining loops and conditionals, this article kicks off a new series on Working with Collections, starting with an introduction to Python lists. This concept is essential for storing and manipulating groups of data and is a foundational element in modern Python development.
Sets: Unordered collections of unique items. Set operations.
We've explored ordered collections like lists and **tuples**, and the key-value world of dictionaries. Now we introduce the final core collection type: the set. Sets are all about uniqueness and are modeled after the mathematical concept of a set.
Tuples: Immutable lists, creating and using tuples
After mastering the flexibility of lists in Part 1 and Part 2, we now turn to their close relative they are immutable. Understanding this distinction is key to writing robust and efficient Python code.