def get_space_indices(plaintext):
    """Description: for a given string input, returns a list containing the
    indices in which spaces occur.

    Arguments:
        plaintext (string): string used to either encode or decode.
    Returns:
        space_indices (list): list contains all indices in which spaces occur.
    """
    space_indices = []
    count = 0
    for i in plaintext:
        if i == ' ':
            space_indices.append(count)
        count += 1
    return space_indices