Python Bangla Tutorials 54 : Inheritance

preview_player
Показать описание
Learning outcomes:
1) what is inheritance ?
2) what is super class and sub class ?
3) why do we need Inheritance?
Full Python Course is here :
Рекомендации по теме
Комментарии
Автор

kom somoye ato sundor explain only anisul sir korte pare, you are great sir

hall_of_fame_suraj
Автор

I was searching for a lecture like this and found this. You're truly a gem, God bless you.

abrarulhasann
Автор

Solution of the exercise:
class Triangle:
def __init__(self, base, height):
self.base = base
self.height = height

def calculate_area(self):
print("The area of the triangle is: ", (0.5*self.base*self.height))

t1 = Triangle(10, 20)
t1.calculate_area()
t2 = Triangle(20, 30)
t2.calculate_area()

mahamudurrahmanbulbul
Автор

Thank you so much.You explained it so much easily❤️❤️

rgcontentz
Автор

Dear sir, where is my error..
class Phone:
def call(self):
print("you can call")
def message (self):
print("you can message")
class Samsung:
def call(self):
print("you can call")
def message (self):
print("you can message")
def photo(self):
print("you can photo")
p =Phone
p.message()
p.call()

bulbulahmed
Автор

Class name (Phone) suru korte ki Always capital later diye likte hobe?? naki Small latter dilao cholbe ??

.saqlainmostaq
Автор

Vaia programming ar jonno best laptop nia akta video banan

dibbajothy
Автор

আসসালামুআলাইকুম স্যার
আমি যদি phone ক্লাসের শুধুমাত্র message method টাকে access করতে চাই samsung/subclass থেকে তাহলে কোডটি কেমন হবে?? class samsung(phone): এইখানে কি কোন পরিবর্তন ঘটবে?

sumaiarahmanontora