< Back

Post Lab 8

Unique Elements

One thing that will be very helpful on your current assignment is the capability of manipulating lists of data. This is a skill that seems a little bit lacking at times, so today seems like a great day to get a start resolving that issue.

In a file called compute_unique.py, write a function called get_unique_elements(a_list). This function takes a list of arbitrary elements as a parameter, and returns a list containing only the unique elements from a_list.

Sample Test Cases

Function Parameters Expected Output
["green", "red", "purple"] ["green", "red", "purple"]
["green", "red", "green"] ["green", "red"]
["green", "green", "green"] ["green"]


Goto http://inquire.roanoke.edu/ You should see a section for post labs. Submit your .py file to the appropriate post lab location.