re: Daily Challenge #35 - Find the Outlier VIEW POST

FULL DISCUSSION
 

Atleast it works somehow 😅

given = [2, 4, 0, 100, 4, 11, 2602, 36] #input array
odds = evens = 0

if given[0]%2 == 0:
    evens  += 1
else:
    odds += 1

if given[1]%2 == 0:
    evens  += 1
else:
    odds += 1

if given[-1]%2 == 0:
    evens  += 1
else:
    odds += 1

if odds > evens:
    for i in given:
        if i%2==0:
            print(i)

else:
    for i in given:
        if not i%2==0:
            print(i)

code of conduct - report abuse