''' How do I avoid repition in for loops python ''' my_list = [1, 2, 2, 3, 4, 4, 5] unique_values = set() for val in my_list: if val not in unique_values: # Do something with the unique value unique_values.add(val)