aboutsummaryrefslogtreecommitdiff
path: root/challenge-213/eric-cheung/python/ch-1.py
blob: 84012d3bd2e8ea4418ca3f5da74ffddb5a2bec6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## arrListInput = [1, 2, 3, 4, 5, 6]  ## Example 1
## arrListInput = [1, 2]  ## Example 2
arrListInput = [1]  ## Example 3

arrListOutput = []

if len(arrListInput) > 1:
    arrListInput.sort()

    for nElem in arrListInput:
        if nElem % 2 == 0:
            arrListOutput.append(nElem)

    for nElem in arrListInput:
        if nElem % 2 == 1:
            arrListOutput.append(nElem)
else:
    arrListOutput = arrListInput

print (arrListOutput)