class Data:
def __init__(self, dia, mes, ano):
self.dia = dia
self.mes = mes
self.ano = ano
def data_formatada(self):
print("{}/{}/{}".format(self.dia, self.mes, self.ano))
PyDev console: starting. Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
from data import Data
datas = Data(27, 11, 2007)
datas.data_formatada()
27/11/2007
`