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