Problem instantiating classes in Python 3

Asked

Viewed 212 times

-1

When I run my program test.py: the debug give it back

Object() takes on Parameters '' on line 4

from tatu2 import Cliente
from tatu2 import Conta

joao = Cliente('João da Silva', '777-1234')
maria = Cliente('Maria da Silva', '555-4321')
conta1 = Conta([joao], 1, 1000)
conta2 = Conta([maria, joao], 2, 500)
conta1.saque(50)
conta2.deposito(300)
conta1.saque(190)
conta2.deposito(95.15)
conta2.saque(250)
conta1.extrato()
conta2.extrato()

Código da minha Classe

  • 3

    Put the file code tatu2.py and the full error message in question also. Take the [tour] to learn the basics of the operation of the site and read the guide of [Ask].

1 answer

2


Your Classes are with the init misspelled. You are writing:

class Cliente:
    def __int__ (self, nome, telefone):

And the right thing would be:

class Cliente:
    def __init__(self, nome, telefone):

Browser other questions tagged

You are not signed in. Login or sign up in order to post.