class Data:
def __init__(self, dia, mes, ano):
print('data {}'.format(self))
self.dia = dia
self.mes = mes
self.ano = ano
def formatada(self):
print(' {} / {} / {}'.format(self.dia, self.mes, self.ano))
Python console from datas import Data datas = Data(21,11,2007) data <datas.Data object at 0x0000025155348550> datas.formatada() 21 / 11 / 2007