Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def evenFirst(l1):
- l = len(l1)
- even = []
- odd = []
- output = []
- for i in range(l):
- for j in range(l):
- if l1[i][j] % 2 == 0:
- even.append(l1[i][j])
- else:
- odd.append(l1[i][j])
- all = even + odd
- def divide_chunks(l, n):
- for i in range(0, len(l), n):
- yield l[i:i + n]
- return list(divide_chunks(all,l))
Add Comment
Please, Sign In to add comment