Question: Write a function called unique that will accept a list of integers, which may contain duplicate values, and returns a list with the duplicates

  1. Write a function called unique that will accept a list of integers, which may contain duplicate values, and returns a list with the duplicates removed. Your function may not use any built-in python functions and must follow the FDR. If you choose, you may implement a helper function that your unique function can call.

Note: The order of the values that appear in the list without duplicates is irrelevant, as long as all of them appear.

Here’s an example:

>>> unique([1, 2, 3, 5, 2, 4, 4, 1])

>>> [1, 2, 3, 5, 4]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python def uniqueinputlist def helperinputlist outputlist ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!