Тёмный

What is `self` in Python? 

AiCore
Подписаться 1,6 тыс.
Просмотров 44 тыс.
50% 1

► Join a high-achieving community of data scientists, data analysts, machine learning engineers, and data engineers who are practicing building industry AI systems at AiCore: www.theaicore.com
► Find out more: theaicore.com
▼ JOIN THE ACTION:
Instagram: / theaicore
Twitter: / theaicore
GitHub: github.com/AI-Core
LinkedIn: / aicore
▼ ABOUT US:
AiCore collaborates with renowned industry brand names to provide step-by-step guides you can follow to get hands-on practice building and enhancing the same systems you might find yourself working on in the industry.
Data science and machine learning are about understanding how data can be used to make critical business decisions and automate processes. Given the vast amounts of data being collected in the digital age, companies across all fields want to utilise their data to inform their decisions and improve operational efficiency.
► Contact us: admissions@theaicore.com
#AiCore #DataEngineer #python

Опубликовано:

 

14 сен 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 54   
@Cimex090
@Cimex090 Год назад
Finally a clear explanation. I've spent the last 2 hours trying to figure this thing out with youtube video but all it took was your 4 min explanation.
@walterstraub150
@walterstraub150 7 месяцев назад
This is the best explanation anywhere on the internet. Thank-you
@PythonArms
@PythonArms Год назад
I have watched about a dozen videos on this topic and this one takes the cake. Well done! Earned a sub from me!
@Henvag
@Henvag 9 месяцев назад
Thank you for explaining. I was fooling around with classes and stumbled upon "self" argument. I got the general idea of it when running the code, but you managed to put it into words for me.
@nayanjha
@nayanjha Год назад
Quite intuitive explanation bro ...makes the life easy for ill explained concepts like "self" !!
@sanankazimov
@sanankazimov 7 месяцев назад
So far the best explanation!!! You are great!
@dbapple
@dbapple 10 месяцев назад
thank you !! the fact that self and instance has the same address, was very useful to me, trying to understand since yesterday.))) and Self == This instance is useful too
@Dashew
@Dashew 5 месяцев назад
This is an amazing explanation. Thank you!!
@DEBLAND
@DEBLAND Год назад
best explain of self parameter i have ever seen thank you
@cyberman1
@cyberman1 Год назад
Well explained, really appriciated!
@jamescullins2709
@jamescullins2709 6 месяцев назад
good job, I have been looking for a good explanation. Thanks
@mR_r0b07
@mR_r0b07 Год назад
If only I had founds this earlier...Thanks Mahn💪🏾👊🏿
@dhalankoriye
@dhalankoriye Год назад
Well explained thank you
@beesanal-attal5679
@beesanal-attal5679 Год назад
well explained thank you !
@lasami5137
@lasami5137 21 день назад
Super helpful!
@diversiontv777
@diversiontv777 Год назад
Thanks man!
@souljarohill8795
@souljarohill8795 Месяц назад
Great explanation
@zahrabt6705
@zahrabt6705 Месяц назад
self is just this instance of the class. well said
@kufirre
@kufirre Год назад
Very good explanation
@thestrappingentrepreneur2822
holy shit you deserve a gold fucking medal for this explanation
@studbud-qw3yo
@studbud-qw3yo 4 месяца назад
its there in his teeth
@bothighlights4179
@bothighlights4179 Месяц назад
well explained!
@MyJoeMarshall
@MyJoeMarshall 11 месяцев назад
Thank you!
@jovany9075
@jovany9075 10 месяцев назад
amazing video
@RanjithKumar-so9ux
@RanjithKumar-so9ux 9 месяцев назад
thank you man💝
@MdWahidurRahmanOvi
@MdWahidurRahmanOvi 7 месяцев назад
Subscribed!!
@MiBaLinuxTech
@MiBaLinuxTech 8 месяцев назад
Thank you now I have understand
@MohMoh-mw9ml
@MohMoh-mw9ml 11 месяцев назад
thanks a lot, my fist time to fully understand it 😂😂❤❤
@circulartext
@circulartext 6 месяцев назад
nice lesson
@legitx420
@legitx420 5 месяцев назад
thank youuuuu
@rizbroz742
@rizbroz742 4 месяца назад
I LOVE YOUUUU
@rahulatal1816
@rahulatal1816 Месяц назад
Sir pls guide for major difference between __new__ and __init__ If __init__ is also a auto-constructor and initializer then why we use __new__ What is the benefit of using __new__ and what problem we face if we Do not use __new__
@beinghappy9223
@beinghappy9223 6 месяцев назад
self is this instance of the class It is the first argument in the method of a class but we don't need to pass it as a parameter while invoking the methods of that class
@beinghappy9223
@beinghappy9223 6 месяцев назад
self is just a converntion not a recognized keyword so we can use any word in place of self but it is better to stick with self
@jag7450
@jag7450 4 месяца назад
if self is "this instance of the class" , in your 'introduce' method, is self.name an instance of the introduce or __init__ since name is a variable of __init__.
@Debelinka
@Debelinka 8 месяцев назад
Thanks for explain, like and sub! 💪🏽🙌🏼
@AshutoshDhaka
@AshutoshDhaka 8 месяцев назад
One should always trust themSELF
@olagarto1917
@olagarto1917 3 месяца назад
but aint "this instance" the default behaviour?, aint it scoped in? i dont get it
@Engineergaming44
@Engineergaming44 3 месяца назад
I love you.
@dbfurrer
@dbfurrer Месяц назад
So it's the same as "this" in JS or Java, but in those other languages you don't have to pass it, it's already there.
@akanshadev6829
@akanshadev6829 Год назад
Finally,confusion cleared.
@unathorizdwatermelon
@unathorizdwatermelon 6 месяцев назад
But why is it necessary at all? Why can’t we just define a function, in this case “Player”, then just assigned them variables and not worry about self at all
@novicetech1
@novicetech1 4 месяца назад
Thank you, thank you, thank you. Jeez!
@vigneshvicky2438
@vigneshvicky2438 2 месяца назад
Haaa. Finallyyy...
@AnotherAgnostic
@AnotherAgnostic Год назад
What I find confusing is why even have to put self in there. It seems redundant. get rid of self and just assume that the class function is referring to itself when you define the attributes.
@dhruvgupta5345
@dhruvgupta5345 Год назад
then you have to define the attributes in every single method of the class and show them in the methods to when you are accessing them
@AnotherAgnostic
@AnotherAgnostic Год назад
@@dhruvgupta5345 I don't get it. If you call a class then have the compiler just assume that self is in there... then you wouldn't have to actually type it in. The calling of the class is all that really matters... saying 'self' each time is redundant since it could be implied. Of course it's going to be self... what else could it be?
@jeannoelhonisch7037
@jeannoelhonisch7037 Год назад
Yeah what i think is, it may be so because of the hierarchie like in js. When developing a programming language, you need to make sure, that every possibility that could occour out will occour. And when i refer to hierarchie, i mean, that every object it self isn't limited to its own created variables. That means that you could also use a variable, that is called the same way, that was created outside of the class or function. By using self, you make sure, that the functions knows, that actually the variable, that was created inside the class or function/method. So in short terms... Its because you could confuse it with another variable from outside, that could have the same name :)
@malakhassan9816
@malakhassan9816 2 месяца назад
I can't see anything
@jasmintea8825
@jasmintea8825 5 месяцев назад
Zeke Jaeger
@andrews882
@andrews882 11 месяцев назад
Excellent! Thanks for the explanation.
@fabianaltendorfer11
@fabianaltendorfer11 Год назад
well explained!
@howardbjackson
@howardbjackson 7 месяцев назад
Thank you!
Далее
Python OOP Tutorial 1: Classes and Instances
15:24
Просмотров 4,4 млн
100❤️
00:18
Просмотров 1,1 млн
ПАПА ГАМБУРГЕР
00:13
Просмотров 120 тыс.
ТОП 10 Худших игроков Евро-2024
30:22
The Harsh Reality of Being a Data Analyst
7:39
Просмотров 561 тыс.
A simple explanation of super() in Python
15:02
Просмотров 46 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 385 тыс.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Просмотров 1,5 млн
*Args and **Kwargs in Python
3:49
Просмотров 254 тыс.
5 Good Python Habits
17:35
Просмотров 421 тыс.
What does Python's __init__ method do?
6:56
Просмотров 31 тыс.
Automate your job with Python
6:07
Просмотров 378 тыс.
What is Python's Main Function Useful For?
8:08
Просмотров 73 тыс.