-
Notifications
You must be signed in to change notification settings - Fork 0
/
multilevel.py
38 lines (23 loc) · 923 Bytes
/
multilevel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Grandfather:
def __init__(self):
self._gfname = "Ram Naresh"
self._surname = " Pandey"
self._gfinherited = 1000000000
self._gfassetworth = 20000000
class Father(Grandfather):
def __init__(self):
super().__init__()
self._fname = " Praveen " + self._gfname
self._finherited = self._gfinherited
self._fassetworth = 200000000 + self._gfassetworth
class Child(Father):
def __init__(self):
super().__init__()
self.cname = input("Enter your first name : ")
self.cname += self._fname + self._surname
self.cinherited = self._finherited
self.cassetworth = self._fassetworth
def getdata(self):
print(f"\n\nHey {self.cname}, \n\tYour Total asset :\n\t\tInherited : {self.cinherited}\n\t\tPurchased : {self.cassetworth}")
a = Child()
a.getdata()