Next ❯ ❮ Previous

Python program for Inheritance


Example1.py

 class Parent:
  x=0
  y=0

 class Child(Parent):
  z=0
  def get(self):
    self.x=100
    self.y=200
    self.z=300

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

 obj=Child()
 obj.get()
 obj.show()


Output

100,200,300
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