We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5c8971 commit 3239ab1Copy full SHA for 3239ab1
1 file changed
oo/pessoa.py
@@ -1,5 +1,6 @@
1
class Pessoa:
2
- def __init__(self, nome=None): # atributos
+ def __init__(self, nome=None, idade=27): # atributos
3
+ self.idade = idade
4
self.nome=nome
5
def cumprimentar(self):
6
return f'Olá Mundo {self.nome}' # se verificar o id de self é o mesmo do p!
@@ -9,5 +10,5 @@ def cumprimentar(self):
9
10
print(p.cumprimentar() )
11
#mudando atributos
12
p.nome='Michel' # agora atribuindo a str Michel.
- print(p.cumprimentar())
13
+ print(p.cumprimentar(),p.idade)
14
0 commit comments