From b00d73348294e84c8347219e14126e0dd95f8f53 Mon Sep 17 00:00:00 2001 From: Vitor Buxbaum Date: Sat, 3 Apr 2021 11:02:07 -0300 Subject: [PATCH] =?UTF-8?q?1.19=20-=20Implementa=C3=A7=C3=A3o=20e=20assert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1_introducao/19_this_self.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 1_introducao/19_this_self.py diff --git a/1_introducao/19_this_self.py b/1_introducao/19_this_self.py new file mode 100644 index 0000000..5c07648 --- /dev/null +++ b/1_introducao/19_this_self.py @@ -0,0 +1,16 @@ +""" +Nesta implementação em Java, o objetivo é ilustrar o uso do objeto 'this'. Em +Python, o objeto equivalente é 'self'. +""" + + +class Conta: + def __init__(self, saldo): + self.saldo = saldo + + +if __name__ == "__main__": + + conta_teste = Conta(123.45) + + assert conta_teste.saldo == 123.45