def prompt_for_choice(prompt, options):
    """Asks for a prompt, returns an index"""
    print(prompt)
    for i, opt in enumerate(options):
        print(f'{i + 1}. {opt}')
    while True:
        raw_choice = input('> ')
        if raw_choice.isdigit() and int(raw_choice) in range(1, len(options
            ) + 1):
            return int(raw_choice)
        print("Sorry, that's not a valid choice.")
