a_list=[1,1,1,1,3,4,5]
one_list=[]
for a in a_list:
if a == 1:
one_list.append(a)
a_list.remove(a)
print(a_list)
print(one_list)
i need to remove 1
from old list which is a_list
and append it in a new list, one_list
. this is how i did it but the output is not like i expected it to be.
here is what i got
[1, 1, 3, 4, 5]
[1, 1]
but my expected output would be
[3, 4, 5]
[1, 1, 1, 1]