<qiyuangong>922_Sort_Array_By_Parity_II_1.py
def sortArrayByParityII( A):
    N = len(A)
    ans = [None] * N
    t = 0
    for i, x in enumerate(A):
        if x % 2 == 0:
            ans[t] = x
            t += 2
    t = 1
    for i, x in enumerate(A):
        if x % 2 == 1:
            ans[t] = x
            t += 2
    
    
    
    return ans
def sample_funcname ( var_0 ) :
    var_2 = len ( var_0 )
    var_4 = [ None ] * var_2
    var_6 = 0
    for var_8 , var_9 in enumerate ( var_0 ) :
        if var_9 % 2 == 0 :
            var_4 [ var_6 ] = var_9
            var_6 += 2
    var_6 = 1
    for var_8 , var_9 in enumerate ( var_0 ) :
        if var_9 % 2 == 1 :
            var_4 [ var_6 ] = var_9
            var_6 += 2
    return var_4
