Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- li1 = ['a', 'a', 'b', 'b', 'b', 'a', 'b', 'aa', 'a', 'b', 'c']
- temp = []
- final = []
- i = 0
- flag = True
- for i in range(len(li1)):
- for j in range(i+1, len(li1)):
- flag = True
- if temp != []:
- for k in temp:
- print(i)
- print(j)
- print(k)
- print()
- if(k == j):
- flag = False
- if((flag == True) and (li1[i] == li1[j])):
- temp.append(j)
- print(temp)
- temp.sort()
- print(temp)
- for i in range(len(li1)):
- flagOK = True
- for l in temp:
- if i == l:
- flagOK = False
- if(flagOK == True):
- final.append(li1[i])
- print("final = ")
- print(final)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement