| about | help | code help+videos | done | prefs | 
| The keys in a dictionary are guaranteed to be unique, but the values are not. Write a function called count_values(mappings)that takes a list of mappings representing a single dictionary as an argument and, after converting the list to its corresponding dictionary, computes and returns the number of distinct values contained in the dictionary. Recall that to create a dictionary from mappings you need the code 
D = {}
for mapping in mappings:
  key = mapping[0]
  value = mapping[1]
  D[key] = value
# at this spot, outside the loop above, it's as if D was the parameter
Paste this code into the space below, then solve the problem with the dictionary D.count_values([['A', 1], ['B', 2], ['C', 3], ['D', 4], ['E', 5]]) → 5 count_values([['A', 1], ['B', 2], ['C', 2], ['D', 3], ['E', 4]]) → 4 count_values([['A', 1], ['B', 1], ['C', 2], ['D', 2], ['E', 3]]) → 3 ...Save, Compile, Run (ctrl-enter) | 
Progress graphs: 
 Your progress graph for this problem
 Random user progress graph for this problem 
 Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy