Untitled
def format_time_slot(time_slot): hour, minutes, seconds = time_slot.split(':') hour = int(hour) if hour == 0: period = 'am' hour = 12 else: if hour >= 1 and hour <= 11: period = 'am' else: period = 'pm' if hour > 12: hour = hour - 12 return str(hour) + ':' + minutes + period