Classe ( arquivo datas.py )
class Data:
def __init__(self, day, month, year):
self.day = day
self.month = month
self.year = year
def formaData(self):
print("{:02d}/{:02d}/{:04d}".format(self.day, self.month, self.year))
utilização ( arquivo teste.py)
from datas import Data
data = Data(21,11,2007)
data.formaData()