Search for tag: "functions"

Lesson 17.11 Graphical Recursion

Fractals are shapes that look the same when you magnify them larger and larger. This is another example of recursion. In this video we introduce the drawing turtle and show how we use it to draw…

From  Hannah Lee on October 19th, 2020 0 plays

Lesson 17.10 Recursion and Helper Functions

Divide-and-conquer is not the only example of recursion. It just happens to be one of the most interesting. But in this video we show that even some of the simplest of recursive definitions become…

From  Hannah Lee on October 19th, 2020 0 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 0 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 0 plays

Lesson 15.7 Mutable List Functions

Because lists are mutable, just like general objects, we can modify them in the body of a function. In this video we show how to write mutable list functions, which are (typically) procedures that…

From  Hannah Lee on October 10th, 2020 12 plays

Lesson 13.3 Assert Statements

Determining responsibility can get really tedious. In this video, we show how we can responsibility explicit by creating errors on purpose. We introduce the assert statement, which will allow us to…

From  Hannah Lee on October 10th, 2020 10 plays

Lesson 13.1 Error Messages

Most of you have seen error messages already, working on the course assignments. But what do these error messages mean? As we seen in this video, we could not really talk about them until now because…

From  Hannah Lee on October 10th, 2020 9 plays

Lesson 12.7 The Call Stack

In this video we look at the call stack in much more detail. In particular, we see that is possible to have more than one call frame active at a time, and the stack is the way these frames are…

From  Hannah Lee on October 2nd, 2020 13 plays

Lesson 12.6 Global Variables

With both modules and function definitions, we saw that global variables are incredibly important. But most of our code is inside of function definitions, and therefore executed inside of call…

From  Hannah Lee on October 2nd, 2020 11 plays

Lesson 12.5 Functions as Variables

If function definitions are objects, then that means we can compute with them like any other object. In this video we show what happens when we assign a function definition to a variable, or why we…

From  Hannah Lee on October 2nd, 2020 11 plays

Lesson 12.3 Modules in Memory

When we say that everything is an object, we include modules as well. In this video we show exactly what happens when you import a module.

From  Hannah Lee on October 2nd, 2020 11 plays

Lesson 11.8 Object Methods

Objects have an interesting feature that we saw before we strings: they have methods in addition to functions. In this video we talk about those methods, and how they differ from string methods.

From  Hannah Lee on October 2nd, 2020 7 plays

Lesson 11.7 Mutable Functions

In the past if we wanted to do any significant computation, we needed a a fruitful function. Procedures are limited to testing or printing stuff out on the screen. But in this video we show how we…

From  Hannah Lee on October 2nd, 2020 6 plays

Lesson11.2 Object Instantiation

Because classes are not built into Python, they do not have literals. So how do we create objects? In this video, we address instantiation which is how do this.

From  Hannah Lee on October 2nd, 2020 9 plays

Lesson 11.1 Objects and Classes

In this video we have to introduce some new terminology. We talk about classes, which are new types that are provided by modules (and therefore not built into Python). Objects are the values for…

From  Hannah Lee on October 2nd, 2020 7 plays