I made this working code but maybe it's possible to make it shorter?
sents_str = 'dimplegalla:28082000 dimplegalla:28082000'
sents = sents_str.split(' ')
uniqueList = []
uniqueRes = []
for letter in sents:
if letter.split(':')[1] not in uniqueList:
uniqueList.append(letter.split(':')[1])
uniqueRes.append(letter)
print(uniqueRes)
.split(':')(which happens to always be'dimplegalla'in your example). Is that intentional?print([sents_str.split()[0]]). But I'm not sure this is what you want.sents_str = 'dimplegalla0:28082000 dimplegalla1:28082000'? And what about'a:0:0 b:0:1'?