cloning over all the old files
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
def removeDuplicates(somelist):
|
||||
seen = set()
|
||||
result = []
|
||||
|
||||
for i in somelist:
|
||||
if i not in seen:
|
||||
seen.add(i)
|
||||
result.append(i)
|
||||
|
||||
return result
|
||||
|
||||
def main():
|
||||
#Create a list with duplicates
|
||||
somelist = [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9]
|
||||
|
||||
#Display the list
|
||||
print(somelist)
|
||||
|
||||
#Use the remove duplicates function to remove duplicate values
|
||||
list_parsed = removeDuplicates(somelist)
|
||||
|
||||
print(list_parsed)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user