Save this video — free

CS 238 Week 2 Lecture

James Andro-Vasko · 40:27 · Watch on YouTube

CS 238 Week 2 Lecture Watch on YouTube →

Overview

James Andro-Vasko introduces object-oriented Python by building a Clock class with an __init__ constructor, instance fields, getters, setters, and a standalone function that accepts a Clock object. The examples explain how self identifies the instance, how setters can normalize hours and minutes with modulo arithmetic, and how assigning one variable to another makes both names refer to the same object.

Key takeaways

Chapters

0:00 Why Python Classes Encapsulate Reusable Data Types
1:27 Defining Clock and Adding an Instance Field
5:04 Initializing Clock Fields with __init__
8:26 Parameterized Constructors and Default Clock Values
16:05 Double-Underscore Fields and Getter Methods
22:34 Setter Methods Normalize Clock Values
33:13 Assigning Clock Variables Creates an Alias
35:24 Passing a Clock Instance to a Standalone Function

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, James Andro-Vasko.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.