Data Types in Python
Learn to choose and use Python lists, tuples, strings, dictionaries, sets and collections types such as Counter and namedtuple in interactive exercises.
Python gives programmers several built-in containers for data, and each suits a different job: keeping values in order, finding them by key, or comparing groups. You work with lists, tuples, strings and dictionaries, then integers, floats, booleans and sets, and learn when each one fits. The later lessons add composite types such as Counter, defaultdict, namedtuple and dataclasses. Questions about a New York baby names dataset give the practice real records to work on.
What You Will Achieve
- Pick a list, tuple or set to suit how a group of values will be ordered, changed or compared
- Work with nested records held in dictionaries, retrieving values safely and keeping entries up to date
- Produce readable text output by joining pieces and inserting values with f-strings
- Count the most common elements and build dictionaries of unknown structure with collections tools
Program Overview
Fundamental Sequence Types: Lists, Tuples and Strings
Ordered containers for storing and looping over data, practiced on questions about the New York Baby Names dataset.
- Changing and looping over lists
- Creating and unpacking tuples, and making them by accident
- Formatted string literals and combining strings
- Finding strings inside other strings
Working with Python Dictionaries
Dictionaries as the root of Python, used to hold data that can be viewed several ways and to answer more baby names questions.
- Creating dictionaries and looping through them
- Safe lookups by key
- Adding, extending, popping and deleting entries
- Nested dictionaries and mixed data types
Numeric Types, Booleans, Sets and Advanced Data Types
Integers, floats and logic values, then sets and the composite types of the collections module and data classes.
- Choosing integers or floats, printing floats and division
- Comparisons and truthy or falsey values
- Set differences and overlaps
- Counter, defaultdict, namedtuple and dataclasses
Certificate Awarded (Paid)
Job Outlook
Choosing a fitting data container is part of everyday Python work in data-related roles, wherever code stores, looks up and compares structured records.
Good for: Learners who use Python for structured data and want a clearer sense of which container fits each job, including the less familiar collections types.
Keep in mind: It is meant for people who already write some Python, not a first introduction to programming, and it moves quickly to nested dictionaries and the collections module.
Bottom line: A practice-led tour of Python’s data types that goes past lists and dictionaries into Counter, defaultdict, namedtuple and dataclasses.
Frequently Asked Questions
Which dataset are the exercises built around?
The first two chapters put lists, tuples, strings and dictionaries to work answering questions about a New York baby names dataset, and the course also includes an extended, multistep case study using Chicago metropolitan area transit data.
When is a set a better choice than a list?
The third chapter presents sets as unordered data with optimized logic operations. Its lessons use them to find the differences between groups, the data two groups share, and everything held across both.
What does the course teach about booleans?
The booleans lessons treat True and False as the logical data type, then move on to comparisons and to the difference between truthy and falsey values and the True and False constants themselves.
What does the final chapter do with namedtuples and dataclasses?
It shows how to create namedtuples for storing data and read their attributes by name, then creates a dataclass and puts it to use. These lessons follow the Counter and defaultdict lessons that open the chapter.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.