def invert_keyword(keyword):
    """Takes in a keyword e.g. [3, 1, 0, 2], which describes the mapping of
    abcd to dbac, and returns the keyword that returns dbac to abcd. So if
    you have a keyword that encrypts a text, the decrypting keyword woud be
    its inverse and vice versa
    """

    # for each index of the inv_keyword, find the position of that index in
    # keyword, and have that as the value, in order to reorder the text.
    # So keyword = [3, 1, 0, 2], we want [2, 1, 3, 0] to return normalcy
    
    inv_keyword = [keyword.index(index) for index in range(len(keyword))]
    return(inv_keyword)