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
Here is a solution that would stop iteration as soon as it finds a dup
>>> from itertools import dropwhile >>> s=set(); next(dropwhile(lambda c: not (c in s or s.add(c)), letters)) 'c'