This should look like what you want
input_str = 'ahuadvzudnioqdazvyduazdazdui'
for c in input_str:
if input_str.count(c)==1:
print(c)
It's easier to understand, but note that it has quite low performance (Complexity of O(n^2)
).
To make it little faster you can use List Comprehension.
input_str = '12345555555678'
[x for x in input_str if input_str.count(x) == 1]
If order of the element doesn't matter to you the iterating over set of the list will be beneficial.
If you convert list into set using set(input_str)
then it will have unique values which may evantually reduce search space.
Then you can apply list complrehension.
input_str = '12345555555678'
[x for x in set(input_str) if input_str.count(x) == 1]
Note: Do not forget the condition that order will not be preserved after converting to set.