Python OOP Tutorial 1: Classes and Instances

Python OOP Tutorial 1: Classes and Instances

Corey Schafer

7 лет назад

4,390,774 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Syncope
Syncope - 17.11.2023 09:16

Thank you for best explanation in the world!

Ответить
Debi Prasad Rath
Debi Prasad Rath - 08.11.2023 20:05

very good content

Ответить
Дальт™
Дальт™ - 06.11.2023 17:12

спасибо

Ответить
Robert Klein
Robert Klein - 04.11.2023 23:23

This was very helpful, but there is still something I'm missing. In the video, each instance of the class (e.g., each employee) must still be given a separate object name (e.g., emp_1 and emp_2). That's fine for this example, but how do you handle the real world situation of a company with thousands of employees and with some coming and gong all the time?

Ответить
Linux Rant
Linux Rant - 02.11.2023 19:56

the format function with those two placeholders and putting it in the return got me slightly lost. Your video is amazing you explain stuff extremely well and as a guy with adhd I was glued and listening the whole time, except the moment with the placeholders and format function, it would be nice if you would explain these things, what you do and how it works, when you implement these weird and unknown spells...
I understand you can't explain everything all the time, but I'm just being honest I subscribe your channel anyway, cos this is good explaining you do. good balance of straight to the point but with some understanding why things are there. except that little format function which I am too weak of a wizard to understand.

Ответить
busy pug
busy pug - 29.10.2023 18:32

thank u, uni did not have a better explanation than this smh

Ответить
Giovanni Mantovani
Giovanni Mantovani - 26.10.2023 14:31

THANK YOU

Ответить
Abdulkadir Öksüz
Abdulkadir Öksüz - 24.10.2023 15:42

thank you. Great explanation

Ответить
Stay Focus
Stay Focus - 23.10.2023 06:33

Thank you for this helpful stuff. I appreciated it, but I am asking some laptop for my studies

Ответить
Gaurav Shukla
Gaurav Shukla - 22.10.2023 10:25

adding this comment because anyone who is looking for a good python oops course you should definetely give it a try

Ответить
el Edo Russo
el Edo Russo - 20.10.2023 21:00

Top tier content

Ответить
Bhaskar M.T
Bhaskar M.T - 13.10.2023 16:54

gawwwwd tqsmmmm i finally get what the self is for

Ответить
Ankit Caring
Ankit Caring - 07.10.2023 18:12

Thankyou soooooo much , i made a whole GUI application at my workplace until now...

Ответить
Hrushikesh-19
Hrushikesh-19 - 03.10.2023 11:08

Thank you Sir

Ответить
Teclote
Teclote - 02.10.2023 10:58

OUTSTANDING !!

Ответить
Ian Norstad
Ian Norstad - 01.10.2023 04:06

Also known as POOP!

Ответить
Prajyot kumar
Prajyot kumar - 30.09.2023 23:17

Thanks

Ответить
Xạ Thiên
Xạ Thiên - 30.09.2023 14:52

U know i can not use oop but oop is the skill i need know. Watch video for u can understand anything. Thank sir

Ответить
Atul bahuguna
Atul bahuguna - 27.09.2023 20:14

Is there any place where you store all tutorial code ?

Ответить
Mind with Curiosity
Mind with Curiosity - 26.09.2023 15:04

Excellent explanation

Ответить
Alireza [ MAIN ]
Alireza [ MAIN ] - 22.09.2023 00:13

I'm a beginner in Python. I think you are using Python 2 . I'm learning Python 3 . Can i follow your tutorials ? or I should look for another video?

Ответить
pittedmetal
pittedmetal - 01.09.2023 13:33

AMAZING VIDEO!!! Thank you so much! ❤

Ответить
bhambho moto
bhambho moto - 23.08.2023 19:45

Nice one

Ответить
No You
No You - 22.08.2023 09:30

I wish I had found this video when I was struggling with classes

Ответить
Isaiah Lopez
Isaiah Lopez - 18.08.2023 19:17

I love how you go through examples of "manually" setting up classes and proceed to use the constructor with the INIT method. out of all the python videos this one explains it amazing. I also appreciate the way you explained class and instances and the differences.

Ответить
Sloane
Sloane - 18.08.2023 14:11

You are the best.

Ответить
nima asali
nima asali - 18.08.2023 12:23

god bless you man , you are a legend.

Ответить
SQL YouTuber
SQL YouTuber - 15.08.2023 17:45

this is so helpful!

Ответить
Andrii Savchyn
Andrii Savchyn - 14.08.2023 21:49

Wow, I finally got it, thanks man!

Ответить
Phone Htet Paing
Phone Htet Paing - 13.08.2023 19:02

Finally, I just found the best explanation of Python OOP!
That's nice!

Ответить
Vladimir Vetohin
Vladimir Vetohin - 12.08.2023 20:24

Thanks a lot, dude! This conception is much clear for me now.

Ответить
Dr Gamma D
Dr Gamma D - 02.08.2023 18:44

Since I don't do work in init, nor do I hard code, (nor do I post links on yt, or apparent links), I would make email a property with the format exposed:

# class attribute for email format, with not looking like a link in comments
_email_format = "{}" + os.extsep + "{}@company" + os.extsep + "com"

@property
def email(self):
return self._email_format.format(self.first, self.seconds)

Ответить
Thr mucix
Thr mucix - 01.08.2023 18:46

you explain python in an easy way than a lot of software engineers out there

Ответить
Mark Kennedy
Mark Kennedy - 28.07.2023 22:18

I can see how objects and instances can be so confusing for people. First off, I understand why people find the self parameter confusing: it basically insists that when we send the object itself as an argument to the parameter self when we call the class for the first time that this object exists (which it doesn't because the instance hasn't been created from the class until we send the argument to self).

Apart from that, all the aliasing (not sure if that's the correct term) going on is confusing: so basically when we call the class to create the instance, we do this by sending arguments which are "aliased" with parameters (blackboxes) which carry the information about the arguments to the right side of any assignments in the body of the class, which are assigned to variables which are created from a parameter (self, which we are not free to make up) dotted with a name we are free to make up. Phew.

Ответить
Vinay Vadlapudi
Vinay Vadlapudi - 28.07.2023 14:58

please make videos on DSA in python

Ответить
Megha Uday
Megha Uday - 26.07.2023 23:44

I am happy I came across your video, it’s very well explained. I am taking an online class and I was not understanding a lot of things. You answered all my questions. Il be checking for more videos from you. Thank you.

Ответить
Carter
Carter - 26.07.2023 07:30

Fantastic Explanation! This vid really helped me understand the concept better

Ответить
ерунда сэндвич
ерунда сэндвич - 23.07.2023 04:59

this is the fastest OOP lesson ever since I learned java and C# LOL

Ответить
Latjor Wuon Lat Dak
Latjor Wuon Lat Dak - 20.07.2023 18:39

@corey Schafer hat is different between self and init ??

Ответить
ENGENHEIRO DE SOFTWARE
ENGENHEIRO DE SOFTWARE - 19.07.2023 04:46

Very good

Ответить
Tam Bui
Tam Bui - 17.07.2023 22:57

Can anyone tell me how he's able to get the output to print "Finished in [x.y]s"? I'd like to enable this setting for my python scripts, but I don't see him actually coding this, so it must be some sort of env setting or template that I'm not aware of. Any help would be greatly appreciated.

Ответить
Mohamed Elmalah
Mohamed Elmalah - 15.07.2023 02:04

Thanks a lot for this wonderful video. I have a small question, how you write multiple lines one at a time when you correct the 1 and made it 2 in the begining of the video.

Ответить
Antonio Lopez
Antonio Lopez - 12.07.2023 20:56

Thank you.

Ответить
TN.
TN. - 11.07.2023 05:41

this is really great. very succint

Ответить
Jose Quaxo
Jose Quaxo - 08.07.2023 22:52

Thank you Mr.Schafer. Your work helps us tremendously.

Ответить
Arun Reddy
Arun Reddy - 06.07.2023 03:21

thanks Corey for the service, got to know about u through chat gpt :) , it would be great help if there is a sequence of all videos to start with .

Ответить