I am writing a wage calculator and after working out how to validate the input format as HH:MM, I'm struggling to remember how to actually loop the code just once and then wait for another user input. Thanks for any help.
Code below;
while not bool(re.match("^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$", wed_start)):
print("Please only use the HH:MM time format.")
wed_fin = input(ask_finish() + ' Wednesday?')
fmt = '%H:%M'
wed_hours = datetime.strptime(wed_fin, fmt) - datetime.strptime(wed_start, fmt)
print(tell_work(), wed_hours, 'hours on Wednesday.')