Multilevel inheritance:
- Multilevel inheritance has derived from the class itself and derives the subclass further.
- It means one base class derived from intermediate class, that intermediate class derived the derived class.
Syntax:
Example:
Output:
Multilevel inheritance:
#Multi level inheritance
class bank:
def pin_set(self):
lst=[1111,1234,2222]
print("\tWelcome to XXX bank")
return lst
class getvalue(bank):
def get_data(self):
pin=int(input("Enter pin number:"))
return pin
class pin_validation(getvalue):
def verification(self,pin,lst):
if pin in lst:
print("Enter your
choice:\n1.Cash widrawel\n2.Cash deposite\n3.Mini statement")
else:
print("Invalid pin")
b=pin_validation()
l=[]
l=b.pin_set()
p=b.get_data()
b.verification(p,l)
Thank you for sharing an amazing & wonderful blog. This content is very useful, informative and valuable in order to enhance knowledge. Keep sharing this type of content with us & keep updating us with new blogs. Apart from this, if anyone who wants to join the Python Advanced training institute in Delhi, can contact 9311002620 or visit our website-
ReplyDeletehttps://www.htsindia.com/Courses/python/online-python-training-institute