Python __init__ and self Explained: Initialize an Object | Advanced Python Lesson 61
Tekotive
0:00 / 0:00
Python __init__ and self Explained: Initialize an Object | Advanced Python Lesson 61
0 просмотров · 1 дн. назад
Tekotive
16 подписчиков
0 просмотров · 1 дн. назад
Learn what _init_ and self do in a Python class: how a new object gets its starting values, how self points to the current instance and how to validate initial state.
Lesson 3 of Object-Oriented Python (lesson 61 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:
The initialization problem
Introduce initialization
Trace self with two instances
Parameter versus attribute
Missing arguments and defaults
Validate initial state
Practice and recap
CHAPTERS
0:00 The initialization problem
0:53 Introduce initialization
2:13 Trace self with two instances
3:09 Parameter versus attribute
4:31 Missing arguments and defaults
5:28 Validate initial state
6:50 Practice and recap
Next: lesson 62 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