Search for tag: "module"

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 3 plays

Lesson 20.8 The None Value

We have seen the None value used in several previous videos. But in this video we finally introduce it formally. In particular, we show why it is so commonly used in object initialization.

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

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 18 plays

Lesson 17.9 Recursion and Objects

Divide-and-conquer is not just limited to sequence types. In this video we show that it works on some objects as well. Specifically, we use it to process a family tree.

From  Hannah Lee on October 19th, 2020 19 plays

Lesson 17.3 Recursion and the Call Stack

Because a recursive function calls itself, it will have multiple call frames on the call stack. In this video we show exactly why we should be concerned about this and why it will affect our function…

From  Hannah Lee on October 19th, 2020 21 plays

Lesson 16.5 Positional For-Loops

Sometimes we need to perform a calculation on a string, list, or tuple, but we do not want to loop over this value. Instead, we want to loop over the positions of the value. In this video we show why…

From  Hannah Lee on October 19th, 2020 17 plays

Zoom Oct. 6. Memory in Python

In this session we take a closer look at the three memory areas of Python. This will help us understand what the Python Tutor is showing when we write more complex programs in the future.The…

From  Hannah Lee on October 10th, 2020 4 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 14 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 12.4 Functions in Memory

We know what happens when we call a function. But as we show in this video, Python also does something very important when we define a function. It has to store the definition somewhere.

From  Hannah Lee on October 2nd, 2020 10 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 12.2 Memory Areas

In this video we introduce the three regions of memory in Python: global space, the heap, and the call stack. We need all of these to understand how Python executes code.

From  Hannah Lee on October 2nd, 2020 12 plays

Lesson 11.5 Object Attributes

Objects are these folders that contain a portfolio of variables. These variables are called attributes. In thie video we talk about how we can access these attributes, or even change them.

From  Hannah Lee on October 2nd, 2020 5 plays

Lesson 9.10 Conditional Scripts

The only difference between a module and a script is how you run it. But we have seen Python files that do different things when you run them as a script or import them as a module. This is done with…

From  Hannah Lee on September 24th, 2020 3 plays