cities = {'beijing': {'country': 'china', 'population': '13', 'fact': 'beautiful'},
'new york': {'country': 'usa', 'population': '3.3', 'fact': 'best'},
'Japan': {'country': 'Tokyo', 'population': '2.3', 'fact': 'fast'},
}
for city, info in cities.items():
print("\n"+city+"\n介绍:")
for key,value in info.items():
print(key + ":" + value)
python从入门到实践第6章习题字典(6.11城市)
最新推荐文章于 2023-10-26 13:59:51 发布