Solução - Criando a classe Pessoa
This commit is contained in:
@@ -8,7 +8,7 @@ Conta (ABC)
|
|||||||
ContaCorrente
|
ContaCorrente
|
||||||
ContaPoupanca
|
ContaPoupanca
|
||||||
|
|
||||||
Pessoa (ABC)
|
Pessoa
|
||||||
Cliente
|
Cliente
|
||||||
Clente -> Conta
|
Clente -> Conta
|
||||||
|
|
||||||
|
|||||||
20
aula158/pessoas.py
Normal file
20
aula158/pessoas.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
class Pessoa:
|
||||||
|
def __init__(self, nome: str, idade: int) -> None:
|
||||||
|
self.nome = nome
|
||||||
|
self.idade = idade
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nome(self):
|
||||||
|
return self._nome
|
||||||
|
|
||||||
|
@nome.setter
|
||||||
|
def nome(self, nome: str):
|
||||||
|
self._nome = nome
|
||||||
|
|
||||||
|
@property
|
||||||
|
def idade(self):
|
||||||
|
return self._idade
|
||||||
|
|
||||||
|
@idade.setter
|
||||||
|
def idade(self, idade: int):
|
||||||
|
self._idade = idade
|
||||||
Reference in New Issue
Block a user