Next, you’ll explore .__len__()
and .__getitem__()
, and how they’re linked to sequences and mappings in Python. You’ll also explore sequences and mappings in more detail later in this course.
This text is part of a Real Python tutorial by Leodanis Pozo Ramos.
Implementing Custom Sequences and Mappings
Python’s sequences and mappings are fundamental built-in data types. Lists, tuples, and strings are examples of sequences, while dictionaries are examples of mapping types.