Skip to content

Commit 724b247

Browse files
criado atributo de classe olhos
1 parent 64ff097 commit 724b247

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

oo/pessoa.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Pessoa:
2+
olhos = 2
23

34
def __init__(self,*filhos, nome=None, idade=21):
45
self.idade = idade
@@ -26,3 +27,8 @@ def cumprimentar(self):
2627
del joe.filhos
2728
print(joe.__dict__)
2829
print(p.__dict__)
30+
p.olhos = 1
31+
del p.olhos
32+
print(Pessoa.olhos)
33+
print(joe.olhos)
34+
print(p.olhos)

0 commit comments

Comments
 (0)