How to remove duplicates from a list of tuples in Python

1 Answer

0 votes
list_of_tuples = [(1, 2), (3, 4), (5, 6), (7, 8), (1, 2), (3, 4), (1, 2)]
 
list_of_tuples = list(set(list_of_tuples))

print(list_of_tuples)   
  
  
  
  
'''
run:
  
[(1, 2), (7, 8), (3, 4), (5, 6)]
  
'''

 



answered Jul 25, 2022 by avibootz

Related questions

...