In this tutorial, you’ll learn the differences between Python lists and tuples. Lists and tuples are fundamental Python container data structures. On the surface, they seem very similar. However, there are a number of unique differences between them that makes… Read More »Python: Differences Between Lists and Tuples
In this tutorial, you’ll learn how to use the built-in Python map() function. This function allows you to process and transform, or “map”, items in an iterable without needing to use a loop to iterate. The function allows you to… Read More »Python map Function: Transforming Iterables without Loops
The Python filter function is a built-in way of filtering an iterable, such as a list, tuple, or dictionary, to include only items that meet a condition. In this tutorial, you’ll learn how to use the filter() function to filter… Read More »Python filter: A Complete Guide to Filtering Iterables
The Python collections module provides a helpful factory function, namedtuple, which allows you to create named tuples in Python. The idea behind named tuples is to make working with tuples more pythonic by allowing you to access data in the… Read More »How to Use Python Named Tuples
Learn how to use Python to swap variables, including with and without a temporary variable and with arithmetic expressions.
Learn how to use Python to append to a tuple, including tuple concatenation, list conversion, and tuple unpacking in this tutorial.
Learn how to use Python to convert a dictionary into a list of tuples, using list comprehensions, the zip function, and collections.
Learn how to use Python to shuffle a list, including being able to reproduce a given result and shuffling Python lists of lists.