I feel like I\'m missing something obvious here!
seq = {\'a\': [\'1\'], \'aa\': [\'2\'], \'aaa\': [\'3\'], \'aaaa\': [\'4\'], \'aaaaa\': [\'5\']} for s in seq
Dictionaries are not ordered. If you need to rely on the ordering, you need an OrderedDict - there's one in the collections module in Python 2.7, or you can use one of the many recipes around.
collections