|
While generators are coroutines, the communication only goes one way: from the child to the calling parent. In this video we show how to reverse this communication, passing down information from the…
Content Categories
Instructional Recordings Creation Date
December 4th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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…
Content Categories
Instructional Recordings Creation Date
December 4th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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.
Content Categories
Instructional Recordings Creation Date
December 4th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
Making iterator classes is hard. In this video, we show an alternative, allowing us to write the iterator as a ‘function”. This requires the addition of a new python statement, the yield…
Content Categories
Instructional Recordings Creation Date
December 4th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
|
|
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.
Content Categories
Instructional Recordings Creation Date
November 12th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
Up until now, the only way that we knew how to create an error is with an assert statement. But these always create errors with the type AssertionError. In this video we show how to create errors…
Content Categories
Instructional Recordings Creation Date
November 12th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
In this video we show how to use the error type to give you more control over a try-except statement. You can chose to recover from some errors, while completely ignoring other errors.
Content Categories
Instructional Recordings Creation Date
November 12th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
In this video, we show that we can solve the problem of strict typing by using the isinstance function. This function will be our preferred way for enforcing preconditions going forward.
Content Categories
Instructional Recordings Creation Date
November 12th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
Getters and setters have another advantage in that they allow us to completely disable to any changes to an attribute. This allows us to separate attributes into mutable and immutable attributes,…
Content Categories
Instructional Recordings Creation Date
October 29th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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…
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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.
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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…
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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.
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
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…
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
Dictionaries are mutable. In this video we show how to alter there contents. This includes reassigning the value of a dictionary for a given key. But it also includes adding and deleting keys.
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|