We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a86e3b0 commit 581a028Copy full SHA for 581a028
1 file changed
oo/pessoa.py
@@ -1,9 +1,18 @@
1
class Pessoa():
2
+
3
+ def __init__(self, nome=None, idade=35):
4
+ self.nome = nome
5
+ self.idade = idade
6
7
def cumprimentar(self):
8
return f'Olá, {id(self)}'
9
10
11
if __name__ == "__main__":
- p = Pessoa()
12
+ p = Pessoa('Dênison')
13
+ print(Pessoa.cumprimentar(p))
14
print(id(p))
15
print(p.cumprimentar())
16
+ p.nome = 'Jhonny'
17
+ print(p.nome)
18
+ print(p.idade)
0 commit comments