From 54c01673de5d3a3647ef47a07354e12802b58700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Fri, 2 Dec 2022 07:33:07 -0300 Subject: [PATCH] =?UTF-8?q?Solu=C3=A7=C3=A3o=20-=20Criando=20a=20classe=20?= =?UTF-8?q?Pessoa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula158/main.py | 2 +- aula158/pessoas.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 aula158/pessoas.py diff --git a/aula158/main.py b/aula158/main.py index 0da7331..99eb9fd 100644 --- a/aula158/main.py +++ b/aula158/main.py @@ -8,7 +8,7 @@ Conta (ABC) ContaCorrente ContaPoupanca -Pessoa (ABC) +Pessoa Cliente Clente -> Conta diff --git a/aula158/pessoas.py b/aula158/pessoas.py new file mode 100644 index 0000000..ac312f5 --- /dev/null +++ b/aula158/pessoas.py @@ -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