def index_all(elm, lst):
    """return list[int] all positions where elm appears in lst. Empty list if not found"""
    if type(list)!=list:
        lst=list(lst)
    return [i for i,e in enumerate(lst) if e==elm]