about | help | code help+videos | done | prefs |
Write a function distinct(data)that returns a list containing ONLY the distinct elements in the list data. Use a dictionary and sort the list before returning it. You may assume that all of the list items are of the same type, so that L.sort() works. distinct(['a', 'b', 'a', 'b', 'c']) → ['a', 'b', 'c'] distinct(['a', 'b', 'A', 'z', 'c']) → ['A', 'a', 'b', 'c', 'z'] distinct([0, 1, 2, 1, 4]) → [0, 1, 2, 4] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy