How to find all non repeating characters in a string with Python

1 Answer

0 votes
from collections import Counter
 
def PrintAllNonRepeatingCharacters(s):
    frequency = Counter(s)
 
    for i in s:
        if (frequency[i] == 1):
            print(i);
 
s = "c c++ csharp java php python"
 
PrintAllNonRepeatingCharacters(s)
 
 
 
 
'''
run:
 
s
r
j
v
y
t
o
n
 
'''

 



answered Sep 4, 2022 by avibootz
edited Sep 4, 2022 by avibootz

Related questions

1 answer 124 views
1 answer 135 views
1 answer 148 views
1 answer 131 views
1 answer 119 views
...