Next ❯ ❮ Previous

Python Multilevel Inheritance


Example3.py

  #Multilevel Inheritance
  #When a class is derived from a child class is known as multilevel inheritance
  class A:
    x=20

  class B(A):
    y=30

  class C(B):
    z=40

    def show(self
      print(self.x," ",self.y," ",self.z)

  obj=C
  obj.show()


Output

20,30,40
Next ❯ ❮ Previous

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved