M3: Dictionaries and File Basics

This module provides an introduction to Python dictionaries, as well as an introduction to working with files.

Pre-recorded Lectures

The pre-recorded lectures are available through Canvas.

The lectures include a series of 5-15 minute videos divided into two sections:

  • 3a - Dictionaries
    • 3a.0 - Introduction

    • 3a.1 - Introduction to Python Dictionaries

    • 3a.2 - Useful Dictionary Operations

    • 3a.3 - Constructing Dictionaries

    • 3a.4 - Iterating over Dictionaries

    • 3a.5 - Accumulation

    • 3a.6 - Data structures and their performance

  • 3b - File Basics
    • 3b.1 - Basic File I/O

    • 3b.2 - CSV Files

    • 3b.3 - JSON and other Formats

Textbook Chapters

The chapters corresponding to this module are:

Note that while there are no videos on sets, they are reviewed in the lab and used in the programming assignment.

A PDF version of the textbook is also available here

You will be asked to log in with your CNetID before you can see the textbook.

Please note that the pre-recorded lectures cover largely the same material as the book. We recommend starting with the pre-recorded lectures, and then reading through the book (but do not feel bad if you find yourself skipping large portions of the textbook, if you feel they tread on material that you already understood when watching the lectures)

Zoom Sessions

You will find the links to the Zoom sessions on Canvas.

  • Week 4
    • Wednesday, October 21th: Lab #3

    • Friday, October 23rd: Q&A and Extended Example.


Lab #3: Dictionaries

In the lecture on Oct 21th, we will be working through a few of the problems in this lab. You are not expected to complete the lab before that lecture, but you should try to read through it so you are familiar with its contents.

Short Exercises

Short Exercises #3, due Sunday, Oct 25 at 3pm CDT

Programming Assignment

Programming Assignment #3, due Friday, Oct 30 at 3pm CDT