i=0
j=0
N=len(L1)
M=len(L2)
L=[]
turn=True
while(i<N and j<M):
if turn:
L.append(L1[i])
i+=1
else:
L.append(L2[j])
j+=1
turn=!turn
while(i<N):
L.append(L1[i])
i+=1
while(j<M):
L.append(L2[j])
j+=1
print(L)
THis can do the trick for you What Is being done is That I am keeping a boolean Turn to Alternate turns to select from the two arrays If You have any doubt regarding the loop logic I can elaborate a little. simple turn= !turn => ALternates turns on each iteration
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…