Skip to main content

2 docs tagged with "Tuples"

View all tags

Common Collection Methods and Best Practices

Over the last several articles, we've explored Python's powerful built-in collection types: lists, tuples, dictionaries, and sets, as well as the specialized containers in the collections module. This article serves as a capstone, summarizing the best practices and helping you decide which collection to use in different scenarios.

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.