Search for tag: "variable"

Lesson 27.2 Animation Frames

The while-loop that drives the game is hidden. This is going to create some interest challenges, particularly when you need variables that carry over from animation frame to animation frame. In this…

From  Hannah Lee on November 30th, 2020 0 plays

Lesson 26.5 While-Loops vs For-Loops

We can always replace for-loops with while-loops, but should we? In this video we talk about the trade-offs of the two control structures and why it might be better to use over the other.

From  Hannah Lee on November 12th, 2020 12 plays

Lesson 26.4 While-Loop Patterns

In this video we introduce two new patterns for while-loops: using a goal condition and using a boolean tracking variable. We see how these patterns allow us to write functions that we could never…

From  Hannah Lee on November 12th, 2020 11 plays

Lesson 26.3 While-Loop Ranges

While-loops require additional patterns beyond the simple accumulator pattern that we used in for-loops. In this video, we talk about the first such pattern, which is replacing the range iterator.…

From  Hannah Lee on November 12th, 2020 13 plays

Lesson 26.2 While-Loop Traces

While-loops can do everything that a for-loop can (and more) but they are much harder to use. That is why, in this video, we talk about how to debug a while-loop before we talk about how to write…

From  Hannah Lee on November 12th, 2020 14 plays

Lesson 26.1 The While-Loop

In this video we talk about the while-loop and explain why it is necessary. In particular, there are types of iteration that are not possible with the for-loop.

From  Hannah Lee on November 12th, 2020 18 plays

Lesson 25.6 Complex Custom Error Types

When we were recording the video on custom error types, it ran quite long. So we decided to break it up into a second video. In this video we look at a slightly more complicated error type. We also…

From  Hannah Lee on November 12th, 2020 29 plays

Lesson23.4 The is Operator

As we saw in the previous video, we cannot trust == if we need to test if two variables refer to the same object folder. In this video we show an alternative operator is, which is safe to use because…

From  Hannah Lee on November 8th, 2020 30 plays

Lesson 22.5 Name Resolution

We have long said that the dot (.) in Python means “inside of the folder”. But which folder? In this video, we show why subclasses makes this question a little less clear. When Python…

From  Hannah Lee on November 8th, 2020 26 plays

Lesson 22.2 Subclass Definitions

In this video we show how to define a subclass. It is exactly the same as defining a class, except that now we actually do something with the parentheses in the function header.

From  Hannah Lee on November 8th, 2020 23 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 34 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 36 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 37 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 42 plays