My professor gave me an exercise where I write a function that returns a list without the duplicate to the old list. This is the code but I don\'t know how to write the meth
Is this considered cheating?
>>> distinct = lambda lst: list(set(lst)) >>> distinct([1,3,1,2,6]) [1, 2, 3, 6] >>> distinct(['a','ab','a','ab']) ['a', 'ab']