python count unique characters in string of list code example
Example 1: find unique char in string python
In [1]: list(set('aaabcabccd'))
Out[1]: ['a', 'c', 'b', 'd']
Example 2: python count distinct letters
string = 'aabbcd'
unique = []
for char in string[::]:
if char not in unique:
unique.append(char)
print(len(unique))