题解 | #首都#
首都
https://www.nowcoder.com/practice/03a5031ed7ad4a7db897fd9ed982ea57
cities_dict={'Beijing': {'Capital': 'China'}, 'Moscow': {'Capital': 'Russia'}, 'Paris': {'Capital': 'France'}} for city,country in sorted(cities_dict.items()): print(f"{city} is the capital of {country['Capital']}!")#Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。