Removing duplicates from a list

Question Q4.2.2

Write a function, using set objects, to remove duplicates from an ordered list. For example,

>>> remove_dupes([1,1,2,3,4,4,4,5,7,8,8,9])
[1, 2, 3, 4, 5, 7, 8, 9]

Solution

To access solutions, please obtain an access code from Cambridge University Press at the Lecturer Resources page for my book (registration required) and then sign up to scipython.com providing this code.