biology = ["Sarah", "Ahmed", "Fred", "Gillian", "Shradah", "Max", "Max", "Sara", "Max", "Esther"]
computerScience = ["Sarah", "John", "Fred", "Gillian", "Jermaine", "Max", "Sara", "Juan", "Esther"]
english = ["Nico", "Sharjeel", "Isabella", "Taylor", "Ali", "Ali", "Jean-Baptiste", "Jean-Baptiste", "Jean-Baptiste", "William"]
setThing=set()
for word in biology:
setThing.add(word)
listThing=[]
for word in setThing:
listThing.append(word)
print(listThing)
In this, I am trying to take the list called biology and put it in a set so that it gets rid of the repeats. I am trying to turn it back into a list that has the same order of names as the list: biology. But when I turned it into a set, the order of the names completely changed. Is there any way I could use some kind of function to order either the new set or the new list so that the names are in the same order as the original "biology" list?