Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pythonbirds teste #51

Open
wants to merge 11 commits into
base: simples
Choose a base branch
from
Empty file added oo/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions oo/pessoa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Pessoa:
def __init__(self, *filhos, nome=None, idade=32):
self.idade = idade
self.nome = nome
self.filhos = list(filhos)

def cumprimentar(self):
return f'Olá!{id(self)}'


if __name__ == '__main__':
renzo = Pessoa(nome='Renzo')
luciano = Pessoa(renzo, nome='Luciano')
print(Pessoa.cumprimentar(luciano))
print(id(luciano))
print(luciano.cumprimentar())
print(luciano.nome)
print(luciano.idade)
for filho in luciano.filhos:
print(filho.nome)