number of distinct characters in a string python code example
Example: python count distinct letters
string = 'aabbcd'
unique = []
for char in string[::]:
if char not in unique:
unique.append(char)
print(len(unique))
string = 'aabbcd'
unique = []
for char in string[::]:
if char not in unique:
unique.append(char)
print(len(unique))