I\'m trying to find the first repeated character in my string and output that character using python. When checking my code, I can see I\'m not index the last character of my co
You can do this in an easier way:
letters = 'acbdc' found_dict = {} for i in letters: if i in found_dict: print(i) break else: found_dict[i]= 1
Output: c
c