arquivo main.py:
from dates import Date
day1 = Date(24, 7, 1)
day1.format_date()
arquivo dates.py:
class Date:
def __init__(self, day, month, year):
self.day = day
self.month = month
self.year = year
def format_date(self):
print(f"Saved date: {self.day:02d}/{self.month:02d}/{self.year:02d}") # ":02d" define a formatação das datas