Python Object Oriented Programming in 10 minutes 🐍

Pubblicato il: 28 December 2020
sul canale di: 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...  
===========================================================


In questa pagina del sito puoi guardare il video online Python Object Oriented Programming in 10 minutes 🐍 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 28 December 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 670,508 volte e gli è piaciuto 35 mille spettatori. Buona visione!