Learn Python POLYMORPHISM in 8 minutes! 🎭

  Рет қаралды 15,262

Bro Code

Bro Code

Күн бұрын

Пікірлер: 26
@BroCodez
@BroCodez 6 ай бұрын
# Polymorphism = Greek word that means to "have many forms or faces" # Poly = Many # Morphe = Form # TWO WAYS TO ACHIEVE POLYMORPHISM # 1. Inheritance = An object could be treated of the same type as a parent class # 2. "Duck typing" = Object must have necessary attributes/methods from abc import ABC, abstractmethod class Shape(ABC): @abstractmethod def area(self): pass class Circle(Shape): def __init__(self, radius): self.radius = radius def area(self): return 3.14 * self.radius ** 2 class Square(Shape): def __init__(self, side): self.side = side def area(self): return self.side ** 2 class Triangle(Shape): def __init__(self, base, height): self.base = base self.height = height def area(self): return self.base * self.height * 0.5 class Pizza(Circle): def __init__(self, topping, radius): super().__init__(radius) self.topping = topping shapes = [Circle(4), Square(5), Triangle(6, 7), Pizza("pepperoni", 15)] for shape in shapes: print(f"{shape.area()}cm²")
@NazneenNaharNishi
@NazneenNaharNishi 6 ай бұрын
Why you are not making Android development tutorial my bro?
@udoydas6513
@udoydas6513 6 ай бұрын
bro plz cover react advanced topics
@Gion-x3t
@Gion-x3t 4 ай бұрын
@7:14 How did giving the subclass the area from its parent cause it to have an area method? Am I not understanding the syntax?
@gbernardo
@gbernardo 6 ай бұрын
Thank you, Bro! I'm from Brazil and I'm learning a lot about Python with your channel, your content is fantastic!!!!
@Ertoko
@Ertoko 6 ай бұрын
This guy is the god of code. He does a tutorial almost every single day
@bola5671
@bola5671 6 ай бұрын
Bro Code, more like God Code. These explanations are amazing. Whenever I need something cut down to digestable python form, I know where to go
@joehaar1466
@joehaar1466 6 ай бұрын
I'm a simple man: I see like - I leave a Bro. Well, you got the point... Thanks for the best lessons one can possibly find
@piano_depois_dos_50
@piano_depois_dos_50 5 ай бұрын
Thank you! Great video (as usual). : )
@William23-dt1mr
@William23-dt1mr 6 ай бұрын
bro please continue the react course :(😕
@Simplifieddeeplearning
@Simplifieddeeplearning 6 ай бұрын
please make video on encapsulation, abstraction, class method, static method and instance method. looking forward to see the videos this week . Thank you
@netkid5460
@netkid5460 6 ай бұрын
did all of those already
@Yuiiiiu123
@Yuiiiiu123 6 ай бұрын
Good work 😊
@motiva-b8u
@motiva-b8u 6 күн бұрын
amazing explanation but i didnt get that abstractmethod part... I havent learnt that before maybe thats why
@Sunford_
@Sunford_ 6 ай бұрын
I don't understand crap help me fr
@malikgulraiz3659
@malikgulraiz3659 6 ай бұрын
Bro please make a series's of Data Structure and Algorithms with JavaScript please.......
@Harun_kf
@Harun_kf Ай бұрын
hi , why he imported the abc and did the @abstractmethod thing
@Yuiiiiu123
@Yuiiiiu123 6 ай бұрын
Variables dance, loops entwine, Functions called, their tasks align, Conditions branch, decisions made, In this digital serenade. Errors lurk in shadows deep, Bugs that make the weary weep, But with each struggle, wisdom grows, And through persistence, knowledge flows. Debugging trails like whispered clues, In forests dense, where logic brews, Step by step, the journey’s charted, Until at last, the code’s imparted. Arrays align, and classes sing, Inheritance and polymorphism bring, A harmony of structured might, In this symphony of code’s delight. Deploy the build, let it be free, Across the world, from sea to sea, Users engage, a dream fulfilled, A coder’s vision, skilled and willed.
@headstrikerop4093
@headstrikerop4093 5 ай бұрын
Its great 👍
@ebatilaye3199
@ebatilaye3199 6 ай бұрын
hi bro i've struggle to learn other programming languages cuz i started by python and i want to be SE help me please
@ebatilaye3199
@ebatilaye3199 5 ай бұрын
Python is easy so if you learn it first it's difficult to learn the others!!
@Batsysup
@Batsysup 3 ай бұрын
hawk = tuah
@Un_revealing
@Un_revealing 6 ай бұрын
Hi Bro
@hamudxd9497
@hamudxd9497 6 ай бұрын
@SURHarold
@SURHarold 6 ай бұрын
LONDON PARIS AMSTERDAM. YEAH IM OVER SEAS
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 160 М.
Python's 5 Worst Features
19:44
Indently
Рет қаралды 113 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
SUPER() in Python explained! 🔴
13:06
Bro Code
Рет қаралды 16 М.
Python MAGIC METHODS are easy! 🌟
13:36
Bro Code
Рет қаралды 11 М.
יש לכם כסף ששוכב בעו"ש? זה מה שהבנקים לא רוצים שתדעו
9:59
כאן | חדשות - תאגיד השידור הישראלי
Рет қаралды 130 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 341 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,3 МЛН
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 755 М.
10 Nooby Mistakes Devs Often Make In Python
24:31
Indently
Рет қаралды 70 М.
Learn Python DUCK TYPING in 4 minutes! 🦆
4:19
Bro Code
Рет қаралды 9 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41