0
I created the code below but it’s giving me error:
Pessoa = Empregados('joao') TypeError: Empregados() takes no arguments.
What I might have done wrong?
class Empregados:
def __int__(self, nome, email, skype):
self.nome = str(nome)
self.email = str(email)
self.skype = str(skype)
def mostrar(self):
print(self.nome, self.email, self.skype)
empr = Empregados('Joao', '[email protected]', 'Joao.vitor')
empr.mostrar()
The name of the method is
__init__
, and not__int__
. Anyway, just do itEmpregados('joao')
will also give error because you also need to pass email and skype– hkotsubo
I got it, it worked, thank you very much.
– Vitorrtw