1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Seperate formatting from constraints checking

This commit is contained in:
Mo 2022-05-09 02:11:28 +02:00
parent 52514957d1
commit 9c35b770a2

View file

@ -69,17 +69,17 @@ def validating_input(
while ans is None or not adj_check_constraints_function(ans): while ans is None or not adj_check_constraints_function(ans):
if not first_run: if not first_run:
print("Invalid input!") print("Invalid input!\n")
else: else:
first_run = False first_run = False
ans = input(prompt) ans = input(prompt)
try: try:
ans = format_function(ans) formatted_ans = format_function(ans)
except Exception as ex: except Exception as ex:
ans = None ans = None
return ans return formatted_ans
def confirm(prompt): def confirm(prompt):