Search for tag: "element"

Lesson 26.6 Mutable While-Loops

In this video we show that the one place we typically prefer while-loops is when we are modifying a list or other mutable iterable. While we did see how to do this with for-loops (by looping over…

From  Hannah Lee on November 12th, 2020 3 plays

Lesson 23.6 The Python Data Model

Python has a lot of special methods than begin and end with double underscores. Together than make up the Python Data Model. In this video we look at the documentation of these methods and try to…

From  Hannah Lee on November 8th, 2020 34 plays

Zoom Oct. 27. Nested Lists and Dictionaries

This presentation explores the last built-in (as opposed to user-defined) types in this course. These types are often used to store data in files.We actually had an (accidental) sneak peak at these…

From  Hannah Lee on October 27th, 2020 7 plays

Zoom Oct. 22. More Recursion

The divide-and-conquer examples we saw in the previous session were on the easy side. In this session we look at some much more challenging examples.Included in this session is segregate, the most…

From  Hannah Lee on October 27th, 2020 5 plays

Zoom Oct. 20. Recursion

Recursion is a powerful programming tool and one of the fundamental principles of computer science. It is used in many advanced algorithms.In this session, we will just focus on divide-and-conquer,…

From  Hannah Lee on October 27th, 2020 10 plays

Lesson 18.4 Nested Slicing

Slicing a list creates a copy. In this video we show what this means for nested lists. In particular, we show that sometimes a copy is not really a copy after all, and that we have to distinguish…

From  Hannah Lee on October 27th, 2020 28 plays

Lesson 18.3 Tables

A table of data is one that is divided up into regular rows and columns. In this video we show how to represent a table as a two-dimensional nested list. While there are alternate ways of…

From  Hannah Lee on October 27th, 2020 23 plays

Zoom Oct. 13. Lists (and Sequences)

In this session we review the two new sequence data types: tuples, and lists. This is the last material on the first prelim.For the most part these are similar to strings, and so we will do a lot of…

From  Hannah Lee on October 19th, 2020 3 plays

Lesson 17.7 The Division Step

Up until now, we have claimed that it does not matter how you divide your date in divide-and-conquer. In this video we show one of the ways in which it might matter. In particular, not thinking about…

From  Hannah Lee on October 19th, 2020 35 plays

Lesson 17.6 Divide and Conquer Visualization

Just because you know how to write a divide-and-conquer algorithm does not mean you understand it. In this video we try to improve our understanding by visualizing divide-and-conquer. When we do this…

From  Hannah Lee on October 19th, 2020 41 plays

Lesson 16.6 Mutable For-Loops

Lists are mutables and support mutable functions. Many of these mutable functions contain for-loops. As we show in this video, this changes how we write the for-loop. In particular, we will not use…

From  Hannah Lee on October 19th, 2020 23 plays

Lesson 16.3 Accumulators

One of the techniques that we say in the previous video was the accumulator variable. In this video we show that this is a general technique used in a fruitful function that requires a for-loop.

From  Hannah Lee on October 19th, 2020 27 plays

Lesson 16.2 For-Loop Design

In this video we show how to use for-loops in function definitions. In particular, we show that we go from a specification to code that uses a for-loop.

From  Hannah Lee on October 19th, 2020 28 plays

Lesson 15.6 List Methods

Lists have many of the same methods as tuples. But since they are mutable, they have even more. In this video we show off some of the mutable methods of lists, which are methods that can alter the…

From  Hannah Lee on October 10th, 2020 14 plays

Lesson 15.3 List Expressions

In this video we introduce the list, which looks almost exactly the the same as a tuple, except that it is written differently. Indeed, it supports many of the same operations as tuples. Together,…

From  Hannah Lee on October 10th, 2020 16 plays

Lesson 15.2 Complex Tuple Expressions

Tuples are very, very similar to strings. In this video we explore this similarity, showing that they support many of the same operations and methods.

From  Hannah Lee on October 10th, 2020 15 plays