mirror of
https://github.com/ada-dmitry/lab6.git
synced 2026-09-24 01:10:15 +00:00
rebase
This commit is contained in:
+23
-4
@@ -46,8 +46,27 @@ def validate_input(prompt, min_value, max_value):
|
||||
print("Введенное значение должно быть числом.")
|
||||
|
||||
|
||||
test1 = 'erhwogngonwro'
|
||||
test2 = '1 minute'
|
||||
test3 = '2 hours 3 minutes'
|
||||
# test1 = 'erhwogngonwro'
|
||||
# test2 = '1 minute'
|
||||
# test3 = '2 hours 3 minutes'
|
||||
|
||||
print(validate_time_format(test1), validate_time_format(test2), validate_time_format(test3))
|
||||
# print(validate_time_format(test1), validate_time_format(test2), validate_time_format(test3))
|
||||
|
||||
def add_zero_before(old_index: str, max_len: str) -> str:
|
||||
"""Функция для "красивого" вывода индексов
|
||||
|
||||
Args:
|
||||
old_index (str): текущий индекс для вывода
|
||||
max_len (int): максимальная длина индексов
|
||||
|
||||
Returns:
|
||||
new_index (str): окончательная версия индекса
|
||||
"""
|
||||
ln = len(old_index)
|
||||
new_index = old_index[:]
|
||||
for i in range(max_len-ln):
|
||||
new_index = '0' + new_index
|
||||
return new_index
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user