days origin
This commit is contained in:
parent
2734c53a02
commit
170e0ddf8d
36
main.py
Normal file
36
main.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
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)
|
Loading…
Reference in New Issue
Block a user