Search for tag: "parameter"

Lesson 28.6 map and filter

In this video we talk about two very famous generators: map and filter. We show how to use these to replace writing code with a for-loop.

From  Hannah Lee on December 3rd, 2020 6 plays

Lesson 28.5 Generator Design

Now that we know how generators work, it is time to write our own. In this video we show how easy it is. We just take out experience with the accumulator pattern and replace the accumulator with a…

From  Hannah Lee on December 3rd, 2020 6 plays

Lesson 28.4 Generator Visualization

Generators look like normal functions, but they do not behave like them. In this video we show how to visualize them, using the Python Tutor.

From  Hannah Lee on December 3rd, 2020 5 plays

Lesson 27.8 Application Design

Game applications (and graphical applications in general) can get pretty complicated. In this video we talk about how to break up your code to make it more readable and more manageable. In some…

From  Hannah Lee on November 30th, 2020 27 plays

Lesson 23.7 Class Methods

Operator overloading is not the only important abstraction tool. In this video we introduce the concept of class methods, which are necessary to add new constructors to a class. These new…

From  Hannah Lee on November 8th, 2020 39 plays

Lesson 21.3 Interface Implementation

Once you have the interface to a class, it is time to start writing code. As we see in this video, the idea is much the same as writing functions. However, attributes – and specifically…

From  Hannah Lee on October 30th, 2020 48 plays

Lesson 20.9 Optional Arguments

Unlike other programming languages, a Python class has only one constructor, If we want to give the user more flexibility when creating objects, we should make certain arguments optional. In this…

From  Hannah Lee on October 27th, 2020 32 plays

Lesson 20.7 Intializers

In this video, we introduce the most important method definition in any class: the initializer. The initializer is responsible for creating all the attributes so that the user does not need to worry…

From  Hannah Lee on October 27th, 2020 39 plays

Lesson 20.5 Method Definitions

In addition to attributes, objects also have methods. In this video, we show how to add a method definition to a class. For the most part, it is as simple as indenting a function definition inside of…

From  Hannah Lee on October 27th, 2020 37 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 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 16 plays

Lesson 13.4 Assert Messages

We now know how to do assert statements to create errors. But the error messages are a little cryptic. In this video we talk about how we can do a better job.

From  Hannah Lee on October 10th, 2020 12 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 8 plays

Lesson 7.3 Preconditions

The one thing that we have not talked about yet are the preconditions in a specification. However, as this video shows, they are arguably the most important part of the specification. They are what…

From  Hannah Lee on September 24th, 2020 6 plays

Lesson 7.2 Specification Format

Now that you know why specifications are so important, it is time to write them. We have a very specific format that we want for our specifications, which is detailed in this video.

From  Hannah Lee on September 24th, 2020 9 plays