other_array=[1,2,3] myarray=[1,2] for item in other_array: if not item in myarray: myarray.append(item)