result_dic={'Allen': ['red', 'blue', 'yellow'],
'Tom': ['green', 'white', 'blue'],
'Andy': ['black', 'pink']}
for dic in sorted(result_dic,reverse=False):
print(f"{dic}'s favorite colors are:")
for color in result_dic[dic]:
print(color)

京公网安备 11010502036488号