代码已经敲好了,望采纳;代码如下:
dict = {}
time = 4
while time >0:
name = input("请输入姓名:")
age = int(input("请输入年龄:"))
dict[name] = age
time -= 1
for eachage in dict.values():
maxage = 0
if eachage > maxage:
maxage = eachage
name1 = list (dict.keys()) [list (dict.values()).index (maxage)]
print("年龄最大的人是:%s,年龄是%d" %(name1, maxage))
实现的效果如图: