方式一:b=[1,2,3,4]c=[x for x in b if x%2 == 0]a=[x for x in b if x%2 != 0]c.extend(a)print(c)方式二:L = [1, 2, 3, 4, 5, 6]index = 0for _ in range(len(L)): if L[index] % 2 == 1: index += 1 else: L.append(L.pop(index))print(L)