b tham khảo thửlst=[]
for idx in range(20):
lst.append(idx)
print(lst)
idx=0
new_lst=[]
for idx in range(len(lst)):
if lst[idx]%2==0 and lst[idx]>0:
new_lst.append(lst[idx])
for idx in range(len(lst)):
if lst[idx]==0:
new_lst.append(lst[idx])
for idx in range(len(lst)):
if lst[idx]%2==1 and lst[idx]>0:
new_lst.append(lst[idx])
print(new_lst)
for idx in range(20):
lst.append(idx)
print(lst)
idx=0
new_lst=[]
for idx in range(len(lst)):
if lst[idx]%2==0 and lst[idx]>0:
new_lst.append(lst[idx])
for idx in range(len(lst)):
if lst[idx]==0:
new_lst.append(lst[idx])
for idx in range(len(lst)):
if lst[idx]%2==1 and lst[idx]>0:
new_lst.append(lst[idx])
print(new_lst)