News for hackers. Stuff that matters.
Re:Ask HN: What topics/subjects are worth learning for a new... by jtchang on Sunday September 16, 2018 @07:43PM (#18001976)
My first thought is below. However I'm not sure if this is a good problem to ask unless you want them to iterate on the solution and you mention you want to do in a functional way.

  def groupByOddThenEvens(someList):

	odds = []
	evens = []

	for x in someList:
	  print x
	  if x % 2 == 0:
	     # Even
	     evens.append(x)
	  else:
	     odds.append(x)

	odds.extend(evens)
	return odds

There are no comments on this comment yet.