Bro Code
Bro Code
  • Видео 778
  • Просмотров 100 084 161
Learn Python DUCK TYPING in 4 minutes! 🦆
# "Duck typing" = Another way to achieve polymorphism besides Inheritance
# Object must have the minimum necessary attributes/methods
# "If it looks like a duck and quacks like a duck, it must be a duck."
class Animal:
alive = True
class Dog(Animal):
def speak(self):
print("WOOF!")
class Cat(Animal):
def speak(self):
print("MEOW!")
class Car:
alive = True
def speak(self):
print("HONK!")
animals = [Dog(), Cat(), Car()]
for animal in animals:
animal.speak()
print(animal.alive)
Просмотров: 1 923

Видео

Learn Python POLYMORPHISM in 8 minutes! 🎭
Просмотров 2,7 тыс.12 часов назад
# 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...
Learn Python NESTED CLASSES in 9 minutes! 📛
Просмотров 1,8 тыс.17 часов назад
# Nested class = A class defined within another class # class Outer: # class Inner: # Benefits: Allows you to logically group classes that are closely related # Encapsulates private details that aren't relevant outside of the outer class # Keeps the namespace clean; reduces the possibility of naming conflicts class Company: class Employee: def init (self, name, position): self.name = name self....
Learn Python COMPOSITION in 7 minutes! 🚘
Просмотров 2,8 тыс.22 часа назад
# Aggregation = A relationship where one object contains references to other INDEPENDENT objects # "has-a" relationship # Composition = The composed object directly owns its components, which cannot exist independently # "owns-a" relationship class Engine: def init (self, horse_power): self.horse_power = horse_power class Wheel: def init (self, size): self.size = size class Car: def init (self,...
Learn Python AGGREGATION in 6 minutes! 📚
Просмотров 2,4 тыс.День назад
# Aggregation = Represents a relationship where one object (the whole) # contains references to one or more INDEPENDENT objects (the parts) class Library: def init (self, name): self.name = name self.books = [] def add_book(self, book): self.books.append(book) def list_books(self): return [f"{book.title} by {book.author}" for book in self.books] class Book: def init (self, title, author): self....
Learn Python @property in 7 minutes! ⚙️
Просмотров 2,5 тыс.День назад
# @property = Decorator used to define a method as a property (it can be accessed like an attribute) # Benefit: Add additional logic when read, write, or delete attributes # Gives you getter, setter, and deleter method 00:00:00 getter 00:03:43 setter 00:05:53 deleter #python #pythonprogramming #pythontutorial
Learn Python ABSTRACT CLASSES in 7 minutes! 👻
Просмотров 2,5 тыс.День назад
# Abstract class: A class that cannot be instantiated on its own; Meant to be subclassed. # They can contain abstract methods, which are declared but have no implementation. # Abstract classes benefits: # 1. Prevents instantiation of the class itself # 2. Requires children to use inherited abstract methods from abc import ABC, abstractmethod class Vehicle(ABC): @abstractmethod def go(self): pas...
How to measure execution time in Python ⌚
Просмотров 1,5 тыс.День назад
# HOW TO MEASURE EXECUTION TIME IN PYTHON import time start_time = time.perf_counter() # YOUR CODE GOES HERE end_time = time.perf_counter() elapsed_time = end_time - start_time print(f"Elapsed time: {elapsed_time:.1f} seconds")
Let's code a beginner's Python SLOT MACHINE 🎰
Просмотров 14 тыс.21 день назад
#python #tutorial #programming This is a beginner's project to help you understand functions, loops, and list comprehensions in Python.
Learn Python list comprehensions 📃
Просмотров 3,3 тыс.21 день назад
# List comprehension = A concise way to create lists in Python # Compact and easier to read than traditional loops # [expression for value in iterable if condition] doubles = [x * 2 for x in range(1, 11)] triples = [y * 3 for y in range(1, 11)] squares = [z * z for z in range(1, 11)] fruits = ["apple", "orange", "banana", "coconut"] uppercase_words = [fruit.upper() for fruit in fruits] fruit_ch...
Let's code a beginner's Python BANK PROGRAM 💰
Просмотров 64 тыс.21 день назад
#python #pythonprogramming #pythontutorial This is an exercise do help us learn about functions in Python. Code for this program is pinned in the comments section down below.
if __name__ == '__main__' for Python beginners 📥
Просмотров 6 тыс.28 дней назад
# if name main : (this script can be imported OR run standalone) # Functions and classes in this module can be reused without the main block of code executing # Good practice (code is modular, helps readability, leaves no global variables, avoids unintended execution) Ex. library = Import library for functionality. When running library directly, display a help page. # script1.py # This file can...
Learn Python CONDITIONAL EXPRESSIONS in 5 minutes! ❓
Просмотров 4,8 тыс.Месяц назад
# conditional expression = A one-line shortcut for the if-else statement (ternary operator) # Print or assign one of two values based on a condition # X if condition else Y
SUPER() in Python explained! 🔴
Просмотров 2,9 тыс.Месяц назад
# super() = Function used in a child class to call methods from a parent class (superclass). # Allows you to extend the functionality of the inherited methods class Shape: def init (self, color, is_filled): self.color = color self.is_filled = is_filled def describe(self): print(f"It is {self.color} and {'filled' if self.is_filled else 'not filled'}") class Circle(Shape): def init (self, color, ...
Python INHERITANCE in 6 minutes! 👨‍👦‍👦
Просмотров 1,9 тыс.Месяц назад
# Inheritance = 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): pri...
Python multiple inheritance is easy! 🐟
Просмотров 1,6 тыс.Месяц назад
Python multiple inheritance is easy! 🐟
Python CLASS VARIABLES explained easy! 🏫
Просмотров 3,2 тыс.Месяц назад
Python CLASS VARIABLES explained easy! 🏫
Learn Python Object Oriented Programming! 🚗
Просмотров 9 тыс.Месяц назад
Learn Python Object Oriented Programming! 🚗
What is INHERITANCE in C++? 👨‍👧‍👧
Просмотров 9 тыс.Месяц назад
What is INHERITANCE in C ? 👨‍👧‍👧
C++ GETTERS & SETTERS explained easy 🔒
Просмотров 6 тыс.Месяц назад
C GETTERS & SETTERS explained easy 🔒
C++ CONSTRUCTOR OVERLOADING explained easy 👨‍🍳
Просмотров 5 тыс.Месяц назад
C CONSTRUCTOR OVERLOADING explained easy 👨‍🍳
C++ CONSTRUCTORS explained easy 👷
Просмотров 8 тыс.Месяц назад
C CONSTRUCTORS explained easy 👷
C++ CLASSES & OBJECTS explained easy 🧍
Просмотров 10 тыс.Месяц назад
C CLASSES & OBJECTS explained easy 🧍
ENUMS in C++ explained easy 📅
Просмотров 5 тыс.Месяц назад
ENUMS in C explained easy 📅
C++ structs as arguments explained 🚚
Просмотров 4,7 тыс.Месяц назад
C structs as arguments explained 🚚
STRUCTS in C++ explained 🏗️
Просмотров 6 тыс.Месяц назад
STRUCTS in C explained 🏗️
What are C++ FUNCTION TEMPLATES? 🍪
Просмотров 5 тыс.Месяц назад
What are C FUNCTION TEMPLATES? 🍪
C++ recursion explained easy 😵
Просмотров 4,8 тыс.Месяц назад
C recursion explained easy 😵
C++ TIC TAC TOE game for beginners ⭕
Просмотров 11 тыс.Месяц назад
C TIC TAC TOE game for beginners ⭕
What is a C++ null pointer? ⛔
Просмотров 6 тыс.Месяц назад
What is a C null pointer? ⛔

Комментарии

  • @YousefHussain-dl7ir
    @YousefHussain-dl7ir 5 часов назад

    this is a random comment! and aaammm yes, this is a great video and serious keep it up!

  • @minmyatthukha1160
    @minmyatthukha1160 6 часов назад

    Bro i really need Angular Framework bro help

  • @yuinni_
    @yuinni_ 6 часов назад

    I'm a native spanish speaker, so this is gonna be a little dificult for me. But I'm gonna do my best! Day 1: 18:24 (I don't go too far cause I need to finish some work)

  • @ndasura1587
    @ndasura1587 7 часов назад

    Yes you are gigachad of reactjs thank you sir 🙏🙏

  • @user-lu8zg5lz6h
    @user-lu8zg5lz6h 7 часов назад

    Great tutorial. Now I am familiar with react. Thank you!

  • @JamesTait-tg2yg
    @JamesTait-tg2yg 8 часов назад

    I understood nothing, and after watching this mans video it all makes sense

  • @enigma12364
    @enigma12364 8 часов назад

    <3

  • @maxdonify
    @maxdonify 8 часов назад

    Nice 👍 please explain how to use lambda inside a function Sir

  • @victoryezeokafor3535
    @victoryezeokafor3535 9 часов назад

    sit back relax and enjoy the show

  • @swapnilverma332
    @swapnilverma332 10 часов назад

    // DAY 2 done

  • @Joe-sx1iu
    @Joe-sx1iu 10 часов назад

    Clear and concise. Love it. Especially the part about the telephones. Brilliant! Thanks!

  • @writamchakraverty3886
    @writamchakraverty3886 10 часов назад

    57:18 Don't worry, you're not wrong :)

  • @bordercut1
    @bordercut1 11 часов назад

    sharp.

  • @lisoojaaa
    @lisoojaaa 11 часов назад

    This is really the best channel, thank you Bro!

  • @mohitanand5646
    @mohitanand5646 11 часов назад

    Thank you for those example codes. Those really help with understanding the concept in-and-out of the box.

  • @noahschwab4909
    @noahschwab4909 11 часов назад

    do the positions also work with pictures ?

  • @sMicrosoft
    @sMicrosoft 11 часов назад

    if I choose the pivot at the begining where do i put my j and i?

  • @KiranNaragam
    @KiranNaragam 11 часов назад

    GOAT Video of HashTable

  • @steevsonsunny5013
    @steevsonsunny5013 11 часов назад

    Good bro it's working properly.....

  • @rzgarabdulwahid8753
    @rzgarabdulwahid8753 11 часов назад

    today i have finished final keyword in java. before starting OOP, do you suggest me to write down some programs ?

  • @anushshetty4268
    @anushshetty4268 12 часов назад

    1:53:45

  • @rajareddyraju6773
    @rajareddyraju6773 12 часов назад

    1:43:14

  • @bhumitchaudhry5364
    @bhumitchaudhry5364 12 часов назад

    The only OOPs tutorial which actually makes sense.

  • @user-fx9kk8ic1b
    @user-fx9kk8ic1b 12 часов назад

    can you share the nulear codes with me ...?

  • @winstonsblues
    @winstonsblues 12 часов назад

    Great breakdown, thanks bro.

  • @barathelango267
    @barathelango267 12 часов назад

    bro is the chad

  • @A__Mel0n
    @A__Mel0n 12 часов назад

    Very good

  • @shricharanramesh7149
    @shricharanramesh7149 12 часов назад

    yo the second example caught me off guard

  • @ganyu5768
    @ganyu5768 12 часов назад

    all your videos are really great Brev. really cool :0 it helps me to learn java again with interest.

  • @AIZEN155
    @AIZEN155 13 часов назад

    nah if you find what you are looking for in code bro's channel, congrats.

  • @Veeru-qm4rg
    @Veeru-qm4rg 13 часов назад

    Before watching this video, I was a little bit scared about learning MongoDB, even though I know SQL. I wasn't interested in learning it and couldn't find good resources. However, this video made learning MongoDB easy. Thank you very much, sir!

  • @shricharanramesh7149
    @shricharanramesh7149 13 часов назад

    Is color not a class variable ?

  • @UmairAhmad-911
    @UmairAhmad-911 13 часов назад

    I wish I got his video before the other bullshit RUclips channel who sound like they wanna die

  • @JeevaD-qf8xi
    @JeevaD-qf8xi 13 часов назад

    eeee

  • @user-zb2jg7le2v
    @user-zb2jg7le2v 13 часов назад

    THANKS

  • @buttstuff1
    @buttstuff1 13 часов назад

    Not gonna lie I chose this c++ course because it said bro code. And anything for the boys!

  • @Comedy_Center12
    @Comedy_Center12 13 часов назад

    Excellent

  • @LMCSoothingMusicChannelGlobal9
    @LMCSoothingMusicChannelGlobal9 13 часов назад

    How do you put a color for one part of the website than a different color for another part of the website?

  • @nischal_
    @nischal_ 13 часов назад

    Day1: 1:01:55

  • @nemosaraswati6537
    @nemosaraswati6537 14 часов назад

    Helping you help me. Thanks!

  • @rajushah8748
    @rajushah8748 14 часов назад

    Everything is so easy and understandable with you bro , Thank you very very much 💕

  • @supremechad8112
    @supremechad8112 14 часов назад

    Whenever I watch your videos I never skip ads

  • @ILSARACADEMY3676
    @ILSARACADEMY3676 14 часов назад

    What is name softwarw you used

  • @Comedy_Center12
    @Comedy_Center12 14 часов назад

    Excellent ❤❤❤

  • @bigbrainChad200
    @bigbrainChad200 14 часов назад

    Yo bro big fan from India i am watching ur basic c++ complete tutorial which u uploaded 2 yrs back its a gem i am learning so much for free i also learnt java gui from you thanks a ton bro

  • @iknowyoureawesome693
    @iknowyoureawesome693 14 часов назад

    Thanks dude

  • @paulhetherington3854
    @paulhetherington3854 15 часов назад

    Derived -- Aubro - declared independence -- You will -- cause disease - eat other id!

  • @paulhetherington3854
    @paulhetherington3854 15 часов назад

    Aubro -- Declared -- frozen riadim officer - nazi! And he be, simulated -- by device net! Program = clinic only -- in any situate!

  • @paulhetherington3854
    @paulhetherington3854 15 часов назад

    /krch P''px || jcn Wn ml~2''x(tTdx'')=tmp array parm z'' < i.e. loch paavlow fr netpachs/ /< + ext thrm mrk loch Wn ml < run tun parmz hlf in 4''tTd(x''(DvF''orb 2''x x 4''xP''px < jcn)/ /krch hlf thrm lyr [rul Wn ml px : < px=jcn ext hlf < 4''tTd abv paavlow < ech vd LN'' array]/ /insrt~2''x@ IC mol < ext mrks array < 24"vF(vd LN''(txz'')Tech || loch Wn ml tun < run rul/

  • @MohammadAmaanButt
    @MohammadAmaanButt 15 часов назад

    random comment