Am trying to check the existence of a string in a list, it might exist more that one time, so when I print the result am getting more then 1 occurance in the result and I want it to print each occurance one time:
This is what I have been doing so far:
spec = [result[:i]+s+result[i+1:]for i in range(len(result)) for s in L if s!=result[i]]
for i in range (0, len(spec)):
if spec[i] in my_list:
print ("R7:You mean:",spec[i])
The input is 'mangge'
The output am getting :
R7:You mean: manège
R7:You mean: mangée
R7:You mean: manège
R7:You mean: mangée
R7:You mean: manège
R7:You mean: mangée
R7:You mean: manège
R7:You mean: mangée
R7:You mean: manège
R7:You mean: mangée
R7:You mean: manège
R7:You mean: mangée
The output am expecting:
R7:You mean: manège
R7:You mean: mangée
Am missing something I don't know what it is !
Aucun commentaire:
Enregistrer un commentaire