1# I've been searching for this for so long so i tought this might help you out.
2
3class Person: #Parent class
4 def __init__(self, fname, lname):
5 self.fname = fname
6 self.lname = lname
7
8 def display(self):
9 '''To check if parent method works'''
10 print(self.fname)
11 print(self.lname)
12
13class Subscriber(Person): #Child class
14 def __init__(self, fname, lname, ID):
15 self.ID = ID
16
17 #The part below this comment is the most important
18 Person.__init__(self, fname, lname)
19 #Make sure all arguments of the Parent class are in the Person.__init__()
20
21 def displayID(self):
22 '''To see if child method works'''
23 print(self.ID)
24
25John = Subscriber("John", "Doe", 1)
26John.display()
27
28#OUPUT:
29#John
30#Doe
31
32John.displayID()
33#OUTPUT
34#1