Collections: Lists, Tuples, Sets, and Dictionaries

Understand some of Python's collection data types such as lists, tuples, sets, and dictionaries.

We'll cover the following

Lists

The next datatype is the list. A list can be a collection of anything; think of it as a one-dimensional array. It has one “row” but as many “columns” as you want. Usually, the data types are the same in a given list, but that convention does not have to be followed. Lists can be sliced just like strs. The official datatype name is list or [], so do not name any list variable plain old list!

Get hands-on with 1400+ tech skills courses.