#How to get the sum of a user created dictionary to print average

3 messages · Page 1 of 1 (latest)

atomic parcel
#
listofemployeenamesandsalaries = {}

#Find out how many employee's user would like to enter
max_length = int(input("How many employees would you like to enter"))



while len(listofemployeenamesandsalaries) < max_length:
    name = input("Enter employee's name: ")
    salary = input("Enter employee's salary: ")

    # If the name isn't in the dictionary add salary value to it
    if name not in listofemployeenamesandsalaries:
        listofemployeenamesandsalaries[name] = salary


print(listofemployeenamesandsalaries)

eager nimbus
#

One way is to loop through the values of the dictionary

#

What have you tried?