0
Am confuse with the super method here
class human: def __init__(self, gender, name, age,): self.gender = gender self.name = name self.age =age def get_name(self): return self.name def is_male(self): if self.gender== 'male': return True return False human1= human('male', 'medx', 19 ) class male(human): super().__init__(gender, name, age) self.voice = voice m1 = male('male','med',18,'male voice')
2 Respostas
0
class male(human):
def __init__(self, gender, name, age,voice):
super().__init__(gender ,name,age)
self.voice = voice
0
GeeksForGeeks explains that very well:
https://www.google.com/amp/s/www.geeksforgeeks.org/JUMP_LINK__&&__python__&&__JUMP_LINK-super/amp/