def move_zero(lst): list_cp=lst.copy() for i in range(len(list_cp)): if list_cp[i]==0: list_cp.pop(i) list_cp.append(0) return list_cp