Тёмный

Python INHERITANCE in 6 minutes! 👨‍👦‍👦 

Bro Code
Подписаться 2,2 млн
Просмотров 8 тыс.
50% 1

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

 

27 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@BroCodez
@BroCodez 5 месяцев назад
# Inheritance = Allows a class to inherit attributes and methods from another class # Helps with code reusability and extensibility # class Child(Parent) class Animal: def __init__(self, name): self.name = name self.is_alive = True def eat(self): print(f"{self.name} is eating") def sleep(self): print(f"{self.name} is asleep") class Dog(Animal): def speak(self): print("WOOF!") class Cat(Animal): def speak(self): print("MEOW!") class Mouse(Animal): def speak(self): print("SQUEEK!") dog = Dog("Scooby") cat = Cat("Garfield") mouse = Mouse("Mickey")
@renioko
@renioko 8 дней назад
can you do vid about generators?
@to4698
@to4698 4 месяца назад
Excellent explanation. Thank you for sharing your knowledge with novice programmers.
@sunkorg
@sunkorg 5 месяцев назад
Cool! Do you have any plans to provide a video where you're comparing inheritance against multiple different popular languages for their differences? Example: Python inheritance vs. JavaScript vs. C# vs. Java, etc. 😊
@colacoca7639
@colacoca7639 5 месяцев назад
You are my idol, how do you learn so fast, im inspired
@burt591
@burt591 Месяц назад
Don't you need to use super? What the difference between doing inheritance like this and doing it with super?
@badger-mr1fi
@badger-mr1fi 5 месяцев назад
Thanks, just what I needed :)
@yezanelcuma7802
@yezanelcuma7802 5 месяцев назад
i love ur vids brocode
@VishalK-fe9gq
@VishalK-fe9gq 2 месяца назад
class Father: height = 182 color = "pink"💀
@ZelaMawla
@ZelaMawla 4 месяца назад
I want to ask, so whats the point for using super() in child class?
@burt591
@burt591 Месяц назад
I'm wondering the same
@burt591
@burt591 Месяц назад
From what I could gather, the super and __init__ in the child class is needed if any attribute is added to the child class. Since in this case no new attribute was added, it wasn't necessary. If you don't override the __init__ method in the subclass Python implicitly uses the __init__ from the parent class.
@ProfShibe
@ProfShibe 5 месяцев назад
the goat
@Johnvids-g3o
@Johnvids-g3o Месяц назад
Who likes dogs/cats?🐶🐱 (I'm a like beggar beacuse many people are like beggars) 👇
Далее
Python MULTIPLE INHERITANCE is easy! 🐟
8:03
Просмотров 4,8 тыс.
Python Decorators in 15 Minutes
15:14
Просмотров 448 тыс.
Wait for it 😂
00:19
Просмотров 4,1 млн
Learn Python Object Oriented Programming! 🚗
12:18
Просмотров 25 тыс.
My 10 “Clean” Code Principles (Start These Now)
15:12
SUPER() in Python explained! 🔴
13:06
Просмотров 11 тыс.
The TRIPLE FOLDING phone has a Problem.
12:54
Просмотров 1,8 млн
5 Useful F-String Tricks In Python
10:02
Просмотров 320 тыс.
Learn Python OOP in under 20 Minutes
18:32
Просмотров 81 тыс.
super/MRO, Python's most misunderstood feature.
21:07
Просмотров 219 тыс.
Python MAGIC METHODS are easy! 🌟
13:36
Просмотров 8 тыс.
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,2 млн
Wait for it 😂
00:19
Просмотров 4,1 млн