When I loop over this list via the given code below:
my_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n']
for i in my_list:
count = my_list.count(i)
if count > 1:
print(i)
it gives me an output ['b','b','n','n']
.
How can I modify my code to just give the duplicated letter only, not each letter in the list without using sets?