def is_even(p): i = 0 count = 0 while(i < len(p)): k = i + 1 while(k < len(p)): if(p[i] > p[k]): count+=1 k+=1 i+=1 if(count == 0): return True if(count % 2 == 0): return True else: return FalseHere is some solution. Could it be done better? Yes.
:)
This is my first code in python ever, so I was kind of 'scared'.