-1
Good afternoon, I wonder if I can find an object using an attribute
Example:
class Pessoa:
def __init__(self, nome, idade, cpf)
self.__nome = nome
self.__idade = idade
self.__cpf = cpf
pessoa1 = Pessoa('Thiago', 19, 000.000.000-00)
pessoa2 = Pessoa('Lucas', 18, 000.000.000-01)
There I want to access person1 only that passing Cpf.
Example:
Cpf 000.000.000-00
return
personal 1
Or something like that
How do you plan to search for this object? It will be the same terminal?
– Marlysson
Yes, in case I will have some objects created, in the source code itself and according to what I type in the terminal, be automatically chosen which object will undergo the changes that a possible method will make
– Thiago da Costa Santos