Python dictionaries don't have an order. However, you can specify an order by using the sorted(domains)
function. By default, it sorts using the key.
for key in sorted(domains):
print key
will produce
de
hu
no
sk
us
If you want to order based on values, you can use something like sorted(domains.items(), key = lambda(k, v): (v, k))
.