def user_confirm(prompt: str) -> bool: while True: ans = input(f'{prompt} [y/N] ').lower() if ans == '': ans = 'n' if ans in ('y', 'n'): break print('Invalid input. Please try again.') if ans == 'n': print('Aborted.') return False return True