Search for tag: "python"

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

Lesson 20.3 Classes and Attributes

The primary role of an object is to store attribute variables. In this video we demonstrate the easiest way to add attributes to an object. We see that we can also add attributes to class folders as…

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 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.3 Dictionary Visualization

Since dictionaries are mutable, we must represent them with folders. In this video we show what these folders must look like. In doing so, we see that they look suspiciously similar to other folders…

From  Hannah Lee on October 27th, 2020 9 plays

Lesson 19.1 Dictionary Expressions

In this video, we introduce a dictionary as a collection of key-value pairs. We also show how to write a dictionary expression in Python. It looks just like a JSON string, but without the quotes.

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

Lesson 18.2 Nested Lists

In this video we show how to handle the special case when the objects inside of a list are other lists. In particular, we show how to chain together brackets to drill down into nested lists.

From  Hannah Lee on October 27th, 2020 6 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.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 16 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 17.2 Recursive Functions

In this video we show how to take recursive definitions from mathematics and implement them in Python. To do this, we will need to have a function call itself in its own definition.

From  Hannah Lee on October 19th, 2020 21 plays