def prompt_guess(position, length):
    """
    Repeatedly prompts the user to make a guess at a given position. Returns the first guess with correct length.
    """
    type_ahead = "Now guess %d letters corresponding to letters %d to %d of the unknown word: "
    input_letters = input(type_ahead % (length, position + 1, position + length))
    # Check that the length of the input is correct
    while len(input_letters) != length:
        print("Invalid guess '%s'. Should be %d characters long." % (input_letters, length))
        print()
        input_letters = input(type_ahead % (length, position + 1, position + length))
    return input_letters