Learn Python Object Oriented Programming! 🚗

preview_player
Показать описание
#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

class Car:
def __init__(self, model, year, color, for_sale):

def drive(self):
# print("You drive the car")

def stop(self):
# print("You stop the car")

def describe(self):
# --------------------------------------

from car import Car

car1 = Car("Mustang", 2024, "red", False)
car2 = Car("Corvette", 2025, "blue", True)
car3 = Car("Charger", 2026, "yellow", True)

# --------------------------------------
Рекомендации по теме
Комментарии
Автор

# 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()

#

BroCodez
Автор

i always wanted to learn more bout poop. thank u so much. ❤️

UznKe
Автор

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!

IGCSENERD-upyv
Автор

You're a real Bro Codez and the real deal for teaching code for easy comprehension!👏👏👏

jamesgig
Автор

Awesome and simplified explanation....

saaransh
Автор

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.👍😃

PratikMoharana
Автор

Thank u so much for this amazing content 🎉

vcmdsqe
Автор

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

CompraMais
Автор

Hahaha is that asmon's room? 0:18 😅

That car def has class, innit?

Progs
Автор

I hit like even befor I watch the video😊.. Thanks a bunch.

mohamedcoufi
Автор

Thanks alot would you explaining the difference of software engineer and software developer and programmer

afgfuturetube
Автор

Hi bro code can u upload a full course of cyber security? Please

zom
Автор

Even though I am not interested ın Python but I found myself clicking on the video bcz of the title🗿

wolftube
Автор

Add these videos to your python paylist bro. It'll be easier for me to watch them all

aashishkandel
Автор

i thought this was a random meme video but instead itsa blessing of Bro xD nice

celshante
Автор

Thank you so much for this, can we have questions like homework for every lesson?

phillipkantunda
Автор

Please bro, We want a tutorial : Algorithms and Data Structures using Python

Greenbay-bnyk
Автор

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!

vallunacoder.wecodetogether
Автор

TypeScript please!!!

And NodeJS & ExpressJS

tioalex-px
Автор

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

elcapitanodeltimbuktuOsir