Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_unique_values(dictionary: dict) -> list:
- """
- Return the list of unique dict values.
- get_unique_values({1: "a", 2: "b"})) => ["a", "b"]
- get_unique_values({1: "a", 2: "b", 3: "a"})) => ["a", "b"]
- The order is not important.
- :param dictionary: Dict to be processed.
- :return: List of unique values.
- """
- new = []
- for letter in dictionary:
- if dictionary[letter] in new:
- break
- else:
- new.append(dictionary[letter])
- return new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement