I am trying to iterate through a column in a text file, where each entry has only three choices A, B, and C
.
I want to identify the number of different types of choices (another text file has A, B, C, and D)
, but if I iterate through each element in the column with a 100 entries
and add it to a list, I'll have multiple repetitions of each type. For example, if I do this, the list might read [A,A,A,B,C,C,D,D,D,B,B...]
, but I want to remove the extraneous entries and just have my list show the distinguishable types [A,B,C,D]
, regardless of how many entries there were.
Any ideas how I might reduce a list with many common elements to a list with only the different distinguishable elements displayed? Thanks!
Desired Output:
[A, B, C, D]