Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
374 B
1
Indexable
Never
def split_list(number_list):
    even_list = []
    odd_list = []
    for i in number_list:
        if (i % 2 == 0):
            even_list.append(i)
        else:
            odd_list.append(i)
    number_list = [None]*(len(odd_list)+len(even_list))
    number_list[::2] = odd_list
    number_list[1::2] = even_list
    print(number_list)
split_list(number_list)