Skip to content

Python Tuples

Differences Between Python Lists and Tuples Cover Image

Python: Differences Between Lists and Tuples

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

Python map Function Transforming Iterables without Loops Cover Image

Python map Function: Transforming Iterables without Loops

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

Python filter A Complete Guide to Filtering Iterables Cover Image

Python filter: A Complete Guide to Filtering Iterables

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

Python Named Tuples Cover Image

How to Use Python Named Tuples

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

Python Swap Variables Cover Image

3 Ways to Swap Variables in Python

Learn how to use Python to swap variables, including with and without a temporary variable and with arithmetic expressions.

Python Append to a Tuple Cover Image

Python: Append to a Tuple (3 Easy Ways)

Learn how to use Python to append to a tuple, including tuple concatenation, list conversion, and tuple unpacking in this tutorial.