我的代码:
favorite_languages={
'Mike':['Java',20],
'Tracy':['C++',21],
'Jack':['Python',19],
}
for name,languages in sorted (favorite_languages.items()):
print(name)
for language in languages:
print(language)
运行结果:
Jack
Python
19
Mike
Java
20
Tracy
C++
21
需要得到的结果:
Jack Python 19
Mike Java 20
Tracy C++ 21
求各位帮忙!