Data Types and Structures in Python
In this week’s workshop, we will explore the core data types and data structures available in Python. Understanding how Python handles data is essential for effective programming, data analysis, and building complex applications.
Introduction
Live coding
Review the material that we explored in Week 3’s live-coding session.
Lab
Exercise: Practice with Python data types and structures
Your task is to:
- Create variables of different types:
integerfloatstringboolean.
- Create:
- A list of five Nigerian states.
- A tuple with three currency codes.
- A set of unique student IDs.
- A dictionary mapping student names to scores.
- Commit and push your work to GitHub.
Further reading
- VanderPlas, J. (2022). Python Data Science Handbook, 2nd Edition. O’Reilly. https://www.oreilly.com/library/view/python-data-science/9781098121211/
- O’Reilly: Beazley, D. (2023). Python Distilled. O’Reilly Media. https://www.oreilly.com/library/view/python-distilled/9780134173399/.
- Python Software Foundation. Official Python Documentation - Data Types. https://docs.python.org/3/library/datatypes.html
- Python Software Foundation. Official Python Documentation - Data Structures. https://docs.python.org/3/tutorial/datastructures.html