我需要某种方式来附加键和键。数据到列表然后操纵该数据。然后我需要对列表进行降序排序,并能够打印出键和值。
list = []
goal scored by team:
(check key England isn't in list)
list.append("England", 0)
else
list["England"] = list["England"] + 1
(check key England isn't in list)
list.append("Scotland", 0)
else
list["Scotland"] = list["Scotland"] + 1
sortdescend(list)
print(list[0])
> "Germany", 25
print(list[1])
> "England", 10
print(list[2])
> "France", 8