RosettaCodeData/Task/Dutch-national-flag-problem/Python/dutch-national-flag-problem-3.py

4 lines
174 B
Python
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
def dutch_flag_sort2(items, order=colours_in_order):
'return summed filter of items using the given order'
return [c for colour in order for c in items if c==colour]