用python输出字典fruits 中键值最大的键值对。 fruits={"apple":10,"mango":12,"durian":20, "banana":5}
时间: 2023-09-23 08:11:56 浏览: 95
fruits = {"apple":10, "mango":12, "durian":20, "banana":5}
max_key = max(fruits, key=fruits.get)
max_value = fruits[max_key]
print(max_key, max_value)
阅读全文