Save this video free

Lecture 16: Dictionaries (with bonus Lambda and Map!)

Professor Rosen · 1:13:19 · Watch on YouTube

Lecture 16: Dictionaries (with bonus Lambda and Map!) Watch on YouTube →

Overview

Professor Rosen builds from character-frequency counting in Project Gutenberg’s Treasure Island file to show why dictionaries are a better fit than fixed-size lists for tracking arbitrary keys and values. He demonstrates dictionary-based character and word counts, discusses normalization and sorting, then introduces functions as values, lambda expressions, and map; course announcements also cover lab deadlines and the final project.

Key takeaways

Chapters

0:00 Lab Deadlines, Course Schedule, and Final Project Planning
8:00 Loading Treasure Island to Explore Character Frequencies
13:16 Why 26 Separate Counters and Character Tests Become Awkward
17:17 Using ord, chr, and enumerate to Count Letters
24:21 Counting ASCII Characters and Finding the Limits of Fixed Indexes
30:07 Python Dictionaries Store Arbitrary Key-Value Pairs
35:44 Dictionary Iteration, Unique Keys, and Practical Uses
42:09 Replacing ASCII Counters with a Dictionary for Character Counts
47:05 Counting Treasure Island Words with split and Dictionary Keys
51:00 Lowercasing Words and Recognizing Punctuation Edge Cases
55:06 Sorting Dictionary Keys and Values with sorted
1:00:55 Treating Python Functions as Values and Passing Them to Other Functions
1:08:17 Lambda Expressions and map for Applying Operations to Lists
1:12:17 Final Project Language and Game-Engine Options

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 All right. So, um administrative announcement so a couple administrative announcements first, and then we will talk about uh the content for the day. So, right? Uh as I sent out in the announcement, which may have been buried in the 104 emails that got sent to you, um the deadline for the assign for the for um all your work is So, not all your work. For lab four and five is Monday, right? The idea here is that if you have not done lab four and five by that point, you are probably irreparably behind in the class. It's not that I can't be lenient and uh

0:48 and and like let students make up work at that point. I have in the past. It's just my experience of having done that has shown that that's never really worked out for the student. It's incurred a lot more stress on them. It's a clear incurred a lot more work on me. And at that point and it and the outcome's always the same. It's still the student does extremely poorly on the exams because they're still that far behind and just struggling to catch up. Um So, that's the issue. Uh that that's the reason why we have that set up. Um the So, just make sure that lab four and five is done. It also kind of removes some students early who have just not shown up. Believe it or not, when I was going through and doing uh W's and U's yesterday, there were a number of

1:34 students with less than 1% in the class. That means that they did not show up, or they have shown up and done precisely like one in-class exercise, or one runestone assignment, and then nothing else. Like at that point, what do we do? So,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Professor Rosen.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.