1
Traceback (Most recent call last): File "C:/udemypy/Basico/classes/heranca/ex2/funcionario.py", line 20, in print(gf.getBonificacao()) File "C:/udemypy/Basico/classes/heranca/ex2/funcio.py", line 16, in getBonification Return super(). getBonification + 1000 Attributeerror: 'super' Object has no attribute 'getBonification'
class Funcionario:
def __init__(self, nome, salario, cpf):
self.nome = nome
self.salario = salario
self.cpf = cpf
def getBonificacao(self):
return self.salario * 0.10
class Gerente(Funcionario):
def getBonificacao(self):
return super().getBonificacao + 1000
gF = Gerente("weliton", 312.22, "332322333")
print(gF.getBonificacao())
If the indentation is as you posted, you set the function
getBonificacao
within the method__init__
and not as class method. Remove an indentation level from this function. Take advantage, in the classGerente
You also did not make the method call, missed the parentheses there. If these are the errors, I believe the question can be closed due to typo.– Woss
Even indentation is wrong
– Weliton Figueiredo
So now we just need to make the method call, as indicated at the end of the previous comment, right?
– Woss