Skip to content

Commit 8def53b

Browse files
committed
criando o método cumprimentar.
1 parent f1396b2 commit 8def53b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

oo/pessoa.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
class Pessoa:
2-
pass
2+
def cumprimentar(self):
3+
return f'Olá {id(self)}'
4+
5+
6+
if __name__ == '__main__':
7+
p = Pessoa
8+
print(Pessoa.cumprimentar(p))
9+
print(id(p))
10+
print(p.cumprimentar(p))

0 commit comments

Comments
 (0)