result = [ (1, 1), (31, 1), (15, 8) ] def get_long_months(): half_year_1 = list(range(1, 8, 2)) half_year_2 = list(range(8, 13, 2)) return half_year_1 + half_year_2 def format_day_or_month(value: int) -> str: if value < 10: value = '0' + str(value) else: value = str(value) return value def print_day(day: tuple) -> str: day, month = day day = format_day_or_month(day) month = format_day_or_month(month) return day + '.' + month def print_days(days: list): for day in days: print(print_day(day)) if __name__ == '__main__': month = get_long_months() print_days(result)