Ravindra BagaleCourses & study guides मराठी Track your progress

Python Lists, Tuples, Dictionaries and Sets Explained with Examples

Ravindra Bagale's Tip — Chala mitrano

One value is not enough for data work. We need many prices, many customers, many cities. Today we learn the four Python containers. A pandas DataFrame is built on these ideas.

What you will learn in this chapter

  • Lists: create, read, add, remove and sort
  • Tuples: fixed values that should not change
  • Dictionaries: key and value pairs
  • Sets: unique values and quick comparisons
  • List of dictionaries — the shape of table data
  • How to choose the right container

Practice data

All names, shops, banks, hospitals and amounts in this chapter are made up for learning. They are not real people or real company numbers.

Concepts in this chapter

  1. P4.1Python Lists: Create, Access, Add and Remove Items
  2. P4.2Python Tuples: When to Use a Tuple Instead of a List
  3. P4.3Python Dictionaries: Keys and Values Explained
  4. P4.4Python Sets: Remove Duplicates and Compare Groups
  5. P4.5List of Dictionaries: How Table Data Looks in Python