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