Input:-
Output:-
class
Person(object):
id=0
name=""
age=""
designation=""
city="
def set(self,id,name,age,designation,city):
self.id=id
self.name=name
self.age=age
self.designation=designation
self.city=city
def get(self):
print()
print("Person details:-")
print("Id:-",self.id)
print("Name:",self.name)
print("Age:-",self.age)
print("Designation:-",self.designation)
print("City:-",self.city)
class
Account(Person):
acc_id=0
acc_type=""
amount=0
def set(self,acc_id,acc_type,amount):
self.acc_id=acc_id
self.acc_type=acc_type
self.amount=amount
print()
print("Account details:-")
print("Account
id:-",self.acc_id)
print("Account
type:-",self.acc_type)
print("amount:-",self.amount)
i
= Person()
i.set(91,"Parth
Shah",27,"Developer","Naroli")
i.get()
z=Account()
z.set(3704,"Saving",10000)
z.get()
Output:-
No comments:
Post a Comment