mirror of
https://github.com/ada-dmitry/lab6.git
synced 2026-09-24 09:20:15 +00:00
added Renata files and developed beauty output
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from datetime import datetime
|
||||
|
||||
def max_len(vals, index):
|
||||
tmp = -1
|
||||
for i in vals:
|
||||
tmp = max(tmp, len(i[index]))
|
||||
if index == 2:
|
||||
return max(tmp, 3)
|
||||
return max(tmp, 7)
|
||||
def check_format(val):
|
||||
format = "%Y-%m-%d"
|
||||
res = True
|
||||
try:
|
||||
res = bool(datetime.strptime(val, format))
|
||||
except ValueError:
|
||||
res = False
|
||||
return not(res)
|
||||
Reference in New Issue
Block a user