Lecture 10: Lists and Mutability
At a glance
- Price Free to watch, no sign-up
- Runtime 1 h 15 min
- Topics Computer Science, Mathematics
- Source MIT, Introduction to CS and Programming using Python
- Lecture Lecture 10 of 25
- Language English
Ana Bell teaches this session of MIT's 6.100L Introduction to CS and Programming using Python, covering how lists and tuples organize data for iterative functions. The lecture works through list operations, mutation, and aliasing, including tricky cases where loops interact with a mutating list. Bell contrasts tuples, suited to fixed data like a latitude and longitude pair or a page and line number, with lists, suited to dynamic data such as a daily top 40 songs chart or a running list of recently watched movies. The seventy five minute session builds on earlier material in the course and works through code examples on screen to show how mutability can produce unexpected behavior when multiple variables reference the same list. Part of MIT OpenCourseWare's Fall 2022 offering of 6.100L.