Write a program that will prompt the user for a series of names and ages. (Use the fake name End to mark the end of the sequence of values.) After the values have been entered, print the average age, and the last names and ages of those individuals with the highest and lowest age.
I have code that will produce an average, oldest, and youngest age but without the corresponding name. I have no idea how to make it work from user input. I am using the latest version of Python and the IDE PyCharm.
#name = input("Enter a series of names with corresponding ages:")
name = ["john", 25, "james", 32, "tanner", 62, "laura", 41, "christine", 21]
pairs = dict([tuple(name[i:i+2]) for i in range(0, len(name), 2)])
avg_salary = sum(pairs.values()) / len(pairs)
print("Average Age: %f" % (avg_age))
high_age = max(pairs.values())
print("Highest Age: %f" % (high_age))
low_age = min(pairs.values())
print("Lowest Age of: %f" % (low_age))