Python Object Oriented Programming in 10 minutes 🐍

Published: 28 December 2020
on channel: Bro Code
670,508
35k

python object oriented programming OOP tutorial example explained

#python #objects #OOP

#------------------------------------------------------------------
from car import Car

car_1 = Car("Chevy","Corvette",2021,"blue")
car_2 = Car("Ford","Mustang",2022,"red")

car_1.drive()
car_2.stop()
#------------------------------------------------------------------
class Car:

def __init__(self,make,model,year,color):
self.make = make
self.model = model
self.year = year
self.color = color

def drive(self):
print("This "+self.model+" is driving")

def stop(self):
print("This "+self.model+" is stopped")
#------------------------------------------------------------------

music credits 🎼 :
===========================================================
Up In My Jam (All Of A Sudden) by - Kubbi   / kubbi  
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Free Download / Stream: http://bit.ly/2JnDfCE
Music promoted by Audio Library    • Up In My Jam (All Of A Sudden) – Kubbi (No...  
===========================================================


On this page of the site you can watch the video online Python Object Oriented Programming in 10 minutes 🐍 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 28 December 2020, share the link with friends and acquaintances, this video has already been watched 670,508 times on youtube and it was liked by 35 thousand viewers. Enjoy your viewing!