Комментарии:
This man is a wizard 🧙♂️ Corey is a python docs alive ❤
ОтветитьThanks for the Post.
Regards,
Giri.
What an explanation Corey ! I come back here again and again whenever I get lost in OOPS concept. This is killer stuff. Thank You very much.
ОтветитьAmazing
Ответитьthank you so much
ОтветитьOne of the best explanations I've found on the subject. The examples are easy to understand and you don't rush anything. Thank you.
Ответитьperfect explanation! perfect!!
ОтветитьEverytime I have an interview, I comeback here.
ОтветитьLet me say loved this video and the bestttt for learning classes❤❤❤❤
Ответитьcorey is a great teacher. his content is well thought out and he explains things efficiently.
ОтветитьThank you
ОтветитьVery useful videos on Python class. Thank you very much. I'd be completely lost without these.
Ответитьamazing explanation, thank you for sharing the knowledge
Ответитьwatching in October 🤔2024, cheers! 🍺
ОтветитьSuperb Explanation...
ОтветитьShow me a better teacher! Cant find any. Corey is super brilliant! Makes complex concepts look like ABC stuff👋👋
ОтветитьIs Developer a subclass of Developer? Answer is True.
Ответитьwatching this after 8 years and still wonderful
Ответить"""
[1] What is Inheritance?
- Inheritance allows a class to inherit attributes and methods from another class.
- The class that is inherited from is called the parent class or *superclass*.
- The class that inherits from the parent class is called the child class or *subclass*.
- Inheritance promotes code reusability and can help in creating a hierarchy of classes.
[2] Creating a Subclass:
- To create a subclass, define a new class with the name of the subclass and specify the parent
class in parentheses.
- Syntax: `class SubClassName(ParentClassName):`
- The subclass inherits all attributes and methods from the parent class unless overridden.
[3] Overriding Methods:
- A subclass can override methods from its parent class to provide a specific implementation.
- This is done by defining a method with the same name in the subclass.
- If a method is overridden, the subclass version is used instead of the parent class version.
[4] The `super()` Function:
- The `super()` function is used to call a method from the parent class in the subclass.
- This is commonly used in the subclass's `__init__` method to initialize the parent class
attributes.
- Syntax: `super().method_name()`
[5] When to Use Inheritance?
- Use inheritance to create a natural hierarchy between classes.
- Ideal when one class is a specialized version of another (e.g., a Dog class that inherits
from an Animal class).
- Helps in code reusability and organization.
"""
Thank you so much!
Ответитьgreat lesson
Ответитьwhy do you set employees=0 under class manager
ОтветитьOne of if not the best free python resources available even till today. I and so many others have learned so much from you man. Your content should be used to teach python at all universities lol. Thanks for all your amazing content man!
ОтветитьThank you so much!!
ОтветитьGreat job Corey. You have explained the topic very well!
ОтветитьCan someone tell me which IDE Corey is using?
ОтветитьIf you have OCD, __init__() and super().__init__() buggs the hell out of you :)
ОтветитьLiked the real world example at the end! Great video!
ОтветитьThanks Corey
the best example and explanation of how to extend a sub-class's parameters that I have come across on the web.
keep up the good work!
I finally get it, thank you!
ОтветитьAmazing tutorial, helped me a lot. Thank you!
Ответитьgreat vids and content, Corey!
ОтветитьThanks a lot, great explanantion
ОтветитьI must say, I have TCM security subscription for python 201 which has a similar lecture on "Inheritance". TBH Corey provided more key points
ОтветитьThank you!
ОтветитьThank you
Ответитьthank you so helpful!
ОтветитьI havent taken my comp sci class in about a year and its really nice to relearn the materials through these videos, thanks for all the help.
ОтветитьThis is a benchmark for teaching, period.
ОтветитьThank you for creating this video for us. I have a question. I noticed that you didn’t add “self.” in method “add_emp”. Shouldn’t it be “self.emp”?
Ответитьq
Ответить