dct = {1: [1, 2, 3, 4, 5], 2:[1, 2, 3], 3:[1, 2, 3, 4, 5, 6, 7, 8, 9], 4:[1, 2, 3, 4, 5, 6, 7, 8], 5:[1, 2, 3, 4, 5, 6, 7, 8, 9]}
{2:[1, 2, 3], 1: [1, 2, 3, 4, 5] , 4:[1, 2, 3, 4, 5, 6, 7, 8], 3:[1, 2, 3, 4, 5, 6, 7, 8, 9], 5:[1, 2, 3, 4, 5, 6, 7, 8, 9]}
dct = {1: [1, 2, 3, 4, 5], 2:[1, 2, 3], 3:[1, 2, 3, 4, 5, 6, 7, 8, 9], 4:[1, 2, 3, 4, 5, 6, 7, 8], 5:[1, 2, 3, 4, 5, 6, 7, 8, 9]}
list_dct = list(dct.items())
list_dct.sort(key=lambda i: len(i[1]))
for i in list_dct:
print(i[0], ':', i[1])
# Вывод:
# 2 : [1, 2, 3]
# 1 : [1, 2, 3, 4, 5]
# 4 : [1, 2, 3, 4, 5, 6, 7, 8]
# 3 : [1, 2, 3, 4, 5, 6, 7, 8, 9]
# 5 : [1, 2, 3, 4, 5, 6, 7, 8, 9]