Search for tag: "function"

Zoom Oct. 29. Classes

In this presentation, we review the class definition. We look at both the syntax (what must be present for the definition to work) and the semantics (how it is processed in Python).Most of this class…

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

Lesson 21.1 Interface vs Implementation

When we implement (or define) a function, we are given a specification and we complete the rest of the body to match the specification. We will do the same thing for classes as well. But as we see in…

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

Lesson 20.10 Representation Methods

When we first introduced objects, we talked about the concept of object representation. But how does Python know how to use this representation. In this video, we see that this is the result of…

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

Lesson 20.6 Method Visualization

Methods definitions look just like function definitions, but we call them differently. In this video we show how to visualize a method call, and we see just how it differs from a function call.

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

Lesson 20.4 Classes Specifications

Classes are something we can define. That means we need a specification to tell us what it means for a definition to be correct. In this video we cover the basics of a class specification, and show…

From  Hannah Lee on October 27th, 2020 7 plays

Lesson 20.2 Class Visualization

Now that you know how to define a class, you need to understand how Python processes the definition. In this video, we see that Python handles it in much the same way, that it does function…

From  Hannah Lee on October 27th, 2020 9 plays

Lesson 20.1 Class Definitions

In this video we show you the basic format of a class definition. However, classes can contain a lot of features, so our classes will be very simple for this demonstration.

From  Hannah Lee on October 27th, 2020 8 plays

Lesson 19.8 Keyword Expansion (OPTIONAL)

This video introduces an advanced topic that is completely optional and will not appear on any exam. Keyword expansion is the dictionary version of tuple expansion. It is used in modules like Kivy to…

From  Hannah Lee on October 27th, 2020 1 plays

Lesson 19.7 Mutable Table Functions

Dictionaries are mutables and support mutable functions. But this is a case where dictionaries are slightly different from lists. We are allowed to loop over a dictionary as we modify it, so long as…

From  Hannah Lee on October 27th, 2020 9 plays

Lesson 19.6 Immutable Dictionary Functions

Since we can loop over dictionaries, that means we probably want to use them in functions with accumulators. In this video we show how to do this and why they are not that much different from lists.

From  Hannah Lee on October 27th, 2020 8 plays