我有以下课程:
class Countries(object):
def __init__(self, country_capital, country_population):
self.capital = country_capital
self.population = country_population
Run Code Online (Sandbox Code Playgroud)
以及连接到类的变量列表:
france = Countries("Paris", "66")
england = Countries("London", "53")
usa = Countries("Washington, DC", "318")
germany = Countries("Berlin", "80")
Run Code Online (Sandbox Code Playgroud)
我如何按人口顺序查看国家()首都?例如["伦敦","巴黎","柏林","华盛顿特区"]