def slowComplete(target_word, list_words, suggest_num):
    """ Search through the word list and return n number of recommended words
    that start with the target word

    Parameter
    ----------
    target_word = the prefix of the word that needs to be matched from the list
    list_words = a list (words and weights) that will be searched
    suggest_num = the number of suggested words that needs to be returned

    Results
    ----------
    recommend_list = a list of top n recommended words and their weights,
    which starts with the target word

    """
    assert suggest_num > 0 and isinstance(suggest_num, int
        ), 'the number of suggested words should be a positive integer'
    assert isinstance(target_word, str
        ), 'the target word should be in a string'
    recommend_list = []
    for ii in range(0, len(list_words)):
        if list_words[ii][1].startswith(target_word
            ) and target_word != list_words[ii][1]:
            recommend_list.append((list_words[ii][0], list_words[ii][1]))
    recommend_list = sorted(recommend_list, key=lambda x: (x[0], x[1]),
        reverse=True)
    recommend_list = recommend_list[0:suggest_num]
    if len(recommend_list) == 0:
        print('Cannot recommend any words')
        return
    elif len(recommend_list) < suggest_num:
        print('Failed to suggest all', suggest_num,
            'words, only suggesting', len(recommend_list), 'words')
    return recommend_list
