Тёмный

Learn Python Object Oriented Programming! 🚗 

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

#python #pythonprogramming #pythontutorial
00:00:00 introduction
00:01:53 classes
00:02:19 constructors
00:04:13 instantiate objects
00:05:06 attribute access operator
00:06:09 multiple objects
00:07:19 modules
00:08:21 methods
00:11:52 conclusion
object = A "bundle" of related attributes (variables) and methods (functions)
Ex. phone, cup, book
You need a "class" to create many objects
class = (blueprint) used to design the structure and layout of an object
-------------- car.py --------------
class Car:
def __init__(self, model, year, color, for_sale):
self.model = model
self.year = year
self.color = color
self.for_sale = for_sale
def drive(self):
print("You drive the car")
print(f"You drive the {self.model}")
print(f"You drive the {self.color} {self.model}")
def stop(self):
print("You stop the car")
print(f"You stop the {self.model}")
print(f"You stop the {self.color} {self.model}")
def describe(self):
print(f"{self.year} {self.color} {self.model}")
--------------------------------------
-------------- main.py --------------
from car import Car
car1 = Car("Mustang", 2024, "red", False)
car2 = Car("Corvette", 2025, "blue", True)
car3 = Car("Charger", 2026, "yellow", True)
print(car1.model)
print(car1.year)
print(car1.color)
print(car1.for_sale)
car1.drive()
car1.stop()
car3.describe()
--------------------------------------

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

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@BroCodez
@BroCodez 2 месяца назад
# --------------- car.py --------------- class Car: def __init__(self, model, year, color, for_sale): self.model = model self.year = year self.color = color self.for_sale = for_sale def drive(self): # print("You drive the car") # print(f"You drive the {self.model}") print(f"You drive the {self.color} {self.model}") def stop(self): # print("You stop the car") # print(f"You stop the {self.model}") print(f"You stop the {self.color} {self.model}") def describe(self): print(f"{self.year} {self.color} {self.model}") # -------------------------------------- # --------------- main.py --------------- from car import Car car1 = Car("Mustang", 2024, "red", False) car2 = Car("Corvette", 2025, "blue", True) car3 = Car("Charger", 2026, "yellow", True) print(car1.model) print(car1.year) print(car1.color) print(car1.for_sale) car1.drive() car1.stop() car3.describe() # --------------------------------------
@beamboy07
@beamboy07 Месяц назад
i luv u
@UznKe
@UznKe 2 месяца назад
i always wanted to learn more bout poop. thank u so much. ❤️
@llowotv
@llowotv 2 месяца назад
i mean keep learning urself, ur icon is poop, not the acronym
@UznKe
@UznKe 2 месяца назад
@@llowotv tf?
@p11
@p11 2 месяца назад
@@UznKe that guy is schizo dont worry about him
@ninjacocovi
@ninjacocovi 2 месяца назад
⁠​⁠@@llowotvyou don’t get that poop is the acronym of Python Object Oriented Programming?
@BroCodez
@BroCodez 2 месяца назад
I'm glad I could help you with your poop
@SabonaMarara
@SabonaMarara 2 месяца назад
i like your video always thanks sir
@IGCSENERD-up6yv
@IGCSENERD-up6yv 2 месяца назад
I want you to comprehend the amount of times I was getting confused before this man came to the scene, I am very grateful of this man and his channel!
@PratikMoharana701
@PratikMoharana701 2 месяца назад
Thanks for uploading. Never stop uploading because we will really miss you. You changed so many lives. I'm always eager to see more of you, no matter whatever the course is. Cover as many languages and frameworks you can. Good luck.👍😃
@saaransh01
@saaransh01 29 дней назад
Awesome and simplified explanation....
@user-vc3md3sq2e
@user-vc3md3sq2e Месяц назад
Thank u so much for this amazing content 🎉
@i_help_strangers
@i_help_strangers 2 месяца назад
Aww man the title got me dying 😂
@mohamedcoufi9873
@mohamedcoufi9873 Месяц назад
I hit like even befor I watch the video😊.. Thanks a bunch.
@jimsvolt
@jimsvolt 2 месяца назад
You are an absolutely gold gem❤
@kazi_goni
@kazi_goni 25 дней назад
Love the way you teach...
@Abinav777
@Abinav777 2 месяца назад
Thank you so much bro❤
@monoq_
@monoq_ 2 месяца назад
You are back! Its a good day today.
@myJapanTV013
@myJapanTV013 Месяц назад
Nicely explained ❤
@celshante1769
@celshante1769 2 месяца назад
i thought this was a random meme video but instead itsa blessing of Bro xD nice
@Zero-Dev64
@Zero-Dev64 2 месяца назад
Thank you bro ❤
@JEEVISAKTHI-pe8hr
@JEEVISAKTHI-pe8hr 2 месяца назад
Bro one like for your fellow bro
@nobeltnium
@nobeltnium Месяц назад
subbed!
@ChrisKoledrianos
@ChrisKoledrianos 2 месяца назад
nice
@rishusingh1995
@rishusingh1995 2 месяца назад
nice. video sir
@nixgen7781
@nixgen7781 2 месяца назад
best guy
@CompraMais4
@CompraMais4 2 месяца назад
I was just watching my teacher teach this and thought it was too hard and I should watch Bro Code teach it. For my surprise, its only been 6 hours. I'll edit how well I learned this after I watched it. Edit: It was way easier than it initially looked like. Bro Code teaching rly well as always
@perfektyoutube9757
@perfektyoutube9757 Месяц назад
Thanks for the video and your help
@luisladino6162
@luisladino6162 Месяц назад
Thanks bro
@afgfuturetube
@afgfuturetube 2 месяца назад
Thanks alot would you explaining the difference of software engineer and software developer and programmer
@phillipkantunda1632
@phillipkantunda1632 2 месяца назад
Thank you so much for this , can we have questions like homework for every lesson?
@Siteit.company
@Siteit.company 2 месяца назад
amazing tutorials
@wolftube5793
@wolftube5793 Месяц назад
Even though I am not interested ın Python but I found myself clicking on the video bcz of the title🗿
@vallunacoder.wecodetogether
@vallunacoder.wecodetogether 2 месяца назад
I''m not learning python but I really loved your videos. I just did the html one and the Javascript one! I was wondering which one should I do next ?? SHOULD I learn read ?? or Java or should I learn about data bases ? I WOULD love to hear your advice! Greeting from Colombia!
@SamahRizwana
@SamahRizwana Месяц назад
You should try out CSS
@shreehari2589
@shreehari2589 2 месяца назад
Thanks for teaching us about the Poop
@aashishkandel197
@aashishkandel197 2 месяца назад
Add these videos to your python paylist bro. It'll be easier for me to watch them all
@zom4275
@zom4275 2 месяца назад
Hi bro code can u upload a full course of cyber security? Please
@throwyourmindat
@throwyourmindat Месяц назад
Funny video banner 😂
@tioalex-px
@tioalex-px 2 месяца назад
TypeScript please!!! And NodeJS & ExpressJS
@kedarppopuri2776
@kedarppopuri2776 2 месяца назад
Bro please make videos for python socket programming please
@Greenbay-bn3yk
@Greenbay-bn3yk 2 месяца назад
Please bro, We want a tutorial : Algorithms and Data Structures using Python
@realm9007
@realm9007 2 месяца назад
me too
@juststig2735
@juststig2735 2 часа назад
I can understand with the title why people wont use this instead of json
@user-sh3zt5nl7f
@user-sh3zt5nl7f 2 месяца назад
Can you do raylib?
@PetrusKaua
@PetrusKaua Месяц назад
que editor de códigos é esse?
@illmatic_2
@illmatic_2 2 месяца назад
Can you create an android tutorial?
@PoPo-jg9nt
@PoPo-jg9nt 2 месяца назад
Next.js tutorial Bro ?
@user-fw3vs7tm1v
@user-fw3vs7tm1v Месяц назад
easyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
@Sav2Swindle
@Sav2Swindle Месяц назад
pls type hinting 4 python
@samtheking5759
@samtheking5759 12 дней назад
thank you, with this video i learnt how to shit- UHH I MEAN i learnt how to use objects and classes... yeah...
@shorty4174
@shorty4174 2 месяца назад
Bro put a picture of his room
@Dex-uq8ff
@Dex-uq8ff 2 месяца назад
One day programming is going to be taken over by Ai and coding would be useless by then... but learning them is great for own use.
@liege4958
@liege4958 Месяц назад
Asmangold streaming room 😂
@intotheuniverse9170
@intotheuniverse9170 2 месяца назад
hi
@elcapitanodeltimbuktu1O1sir
@elcapitanodeltimbuktu1O1sir 2 месяца назад
Some People Say Python is Shit Language😂 But For Now Python Saved By Ai 😂 Btw If Newbie Don't Know What Is SELF "self" is same as "this" In Js,java But In Js & Java You Don't Need To Pass Keyword "this" To Identify Its Object
@RakibHasan-hs1me
@RakibHasan-hs1me 2 месяца назад
U can't use OOP?
@user-fw3vs7tm1v
@user-fw3vs7tm1v Месяц назад
thats OOP. there is more in it. its just beginning.
@C4ManMike
@C4ManMike 2 месяца назад
Lol a shot of asmongolds beadroom
@navtektv
@navtektv 21 день назад
I can definitely poop in 12 minutes.
@pyroclastic8924
@pyroclastic8924 2 месяца назад
everyone remember to thank brocode for showing us his poop
@bim282
@bim282 2 месяца назад
POOP 💀💀
Далее
Python CLASS VARIABLES explained easy! 🎓
8:16
Просмотров 5 тыс.
Let's code a HANGMAN GAME in Python! 🕺
25:07
Просмотров 4,8 тыс.
5 Good Python Habits
17:35
Просмотров 460 тыс.
Python lists, sets, and tuples explained 🍍
15:06
Просмотров 251 тыс.
Please Master These 10 Python Functions…
22:17
Просмотров 105 тыс.
SUPER() in Python explained! 🔴
13:06
Просмотров 4,9 тыс.
Learn Python DECORATORS in 7 minutes! 🎊
7:22
Просмотров 6 тыс.
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1,1 млн
Python MAGIC METHODS are easy! 🌟
13:36
Просмотров 3,8 тыс.