Python Classes and Objects Explained: Attributes and __init__ | Advanced Python Lesson 60
Tekotive
0:00 / 0:00
Python Classes and Objects Explained: Attributes and __init__ | Advanced Python Lesson 60
6 просмотров · 2 дн. назад
Tekotive
18 подписчиков
6 просмотров · 2 дн. назад
Learn Python classes and objects from first principles: the difference between a class and an object, attributes, __init__, self and why two objects are independent.
Lesson 2 of Object-Oriented Python (lesson 60 of the Advanced Python playlist). One running example, a student management application, built with real Python code that was run and checked.
In this lesson:
From a record to an object
A class is a definition
Two separate instances
Adding attributes
A missing attribute error
Introducing _init_
Trace the constructor call
State stays independent
Names, references, and identity
Debugging a common mistake
Independent practice
Wrap-up and next lesson
CHAPTERS
0:00 From a record to an object
1:01 A class is a definition
2:03 Two separate instances
2:52 Adding attributes
3:44 A missing attribute error
4:28 Introducing _init_
5:32 Trace the constructor call
6:27 State stays independent
7:16 Names, references, and identity
8:14 Debugging a common mistake
9:14 Independent practice
10:08 Wrap-up and next lesson
Next: lesson 61 of this course.
New to Python? Start with the beginner course, Python from First Principles: • Python from First Principles
Full Advanced Python playlist: • Advanced Python
New to the channel? Watch the intro first: • How to Switch to Tech From a Non-Tech Back...
If this helped, subscribe so you do not miss the next lesson.
From Tekotive. More lessons: / @tekotive
#python #pythonoop #objectorientedprogramming